The gunman then shot and killed himself, Weld County Sheriff John Cook said.
The victims included the ex-girlfriend's sister and the sister's husband. All were found dead in a home in unincorporated Weld County outside Longmont, about 35 miles north of Denver.
Cook identified the dead as 25-year-old Beatriz Cintora-Silva; her sister, Maria Cintora-Silva, 22; and Max Aguirre Ojeda, 32, who was Maria Cintora-Silva's husband.
The gunman was identified as Daniel Sanchez, 31.
Authorities said Beatriz Cintora-Silva called 911 shortly after 4 a.m. to report shots fired. The 911 dispatcher heard her cry, "No, no, no," followed by a gunshot.
Sanchez took the phone, told the dispatcher he had killed three people and that he was going to kill himself, authorities said. The dispatcher then heard a single shot followed by silence.
Cook said Sanchez had been arrested Saturday in Longmont on charges of domestic violence, kidnapping and false arrest for allegedly holding Maria Cintora-Silva against her will after their relationship ended.
Sanchez was released on bail from the Boulder County jail at 10 p.m. Monday and drove to the home where Cintora-Silva had taken refuge with her sister and brother-in-law, Cook said.
"He shot out the back door," Cook said. "He shot that out then gained entry into the house."
The bodies of Ojeda and his wife were found in one bedroom and Maria Cintora-Silva and Sanchez were found in another, Cook said.
Authorities found a .45-caliber Glock handgun near Sanchez's body and 16 spent shell casings around the house, Cook said, adding that investigators were still examining the house and might find more.
Cook said Sanchez had two magazines for the gun, and each held 13 rounds of ammunition.
Sanchez had been living in another house in the same neighborhood of tidy modular homes, winding walkways and parks. Investigators searching that home found the original box the handgun had been sold in, but they did not find a receipt, and it was unclear when he bought it, Cook said.
As investigators searched the home, a woman slipped under the crime scene tape and ran toward the house. The unidentified woman was restrained by deputies, fell to the ground on her knees and began crying before being led away.
A pickup truck with Texas license plates, meanwhile, sat idling in the driveway while police waited for permission to enter the vehicle. A neighbor said it had been running since morning.
Several neighbors described what happened around 4 a.m. Tuesday.
Joyce Vibbert said she heard three gunshots and a woman's voice.
"It was just screaming. I couldn't hear what she was saying. It was just screaming," she said.
Vibbert said she couldn't see what was happening from her bedroom window.
Kathy Tubb said she heard the shots at about the same time.
She said when her husband went outside to warm up the car to go to work, he saw a policeman wearing a helmet and armed with a rifle standing in the street. Tubb said her husband was worried there might be a gunman still on the loose.