Patients and staff took cover under furniture and inside locked rooms at the Planned Parenthood clinic in Colorado Springs as the suspect, named as Robert Lewis Dear, 57, barricaded himself inside and fired intermittently.
For several hours, the firing of a gun was the only indication police had that the shooter was in the building, officials said.
As the standoff progressed, officers inside the building herded people into one area and evacuated others.
Two civilians and a police officer were killed in a firefight before the suspect surrendered and was taken into custody by the authorities.
A law enforcement official identified the gunman as Dear, of North Carolina.
“We don’t have any information on this individual’s mentality, or his ideas or ideology,” Colorado Springs police lieutenant Catherine Buckley told reporters on Friday.
Yesterday she said the items that Dear brought to the scene were “no longer a threat” but she would not give details.
Investigators expect to study the crime scene for several days, Buckley said.
Planned Parenthood said all of its staff at the clinic were safe and it did not know the circumstances or motives behind the attack or whether the clinic itself was the target.
Its clinics have been the target of repeated protests by anti-abortion campaigners in recent years.
President Barack Obama released a statement saying: “If we truly care about this – if we’re going to offer up our thoughts and prayers again, for God knows how many times, with a truly clean conscience – then we have to do something about the easy accessibility of weapons of war on our streets to people who have no business wielding them.
“Period. Enough is enough.”
The police officer killed in the shooting was named as 44-year-old Garrett Swasey, who was married and had a son and daughter.
There were no immediate details about the two civilians killed in the attack.
Five officers and four others were hospitalised but were in a “good” condition, according to police.
Witnesses described a chaotic scene when the shooting started just before noon on Friday.
Ozy Licano was in the two-storey building’s car park when he saw someone crawling towards the clinic’s door. He tried to escape in his car when the gunman looked at him.
He said: “He came out, and we looked each other in the eye, and he started aiming, and then he started shooting.
“I saw two holes go right through my windshield as I was trying to quickly back up and he just kept shooting and I started bleeding.”
Licano drove away and took refuge in a nearby shop.
Inside the clinic, terrified patients and staff hid wherever they could find cover.
Jennifer Motolinia ducked under a table and called her brother Joan to leave instructions for the care of her three children in case the gunman found her.
Motolinia said he could hear gunshots in the background while his sister spoke.