COLORADO SPRINGS, Colo. - A gunman who opened fire inside a Colorado Springs Planned Parenthood clinic was arrested Friday after engaging in gun battles with authorities during an hours-long standoff that killed three people and wounded nine others, officials said.

The dead include a police officer with the University of Colorado in Colorado Springs, law enforcement officials said.

The university police department identified the officer as Garrett Swasey, 44, a six-year veteran of the force.

The nine people injured in the shooting, including five police officers, were in good condition, police said.

"The perpetrator is in custody," Mayor John Suthers declared just after 5 p.m. (7 p.m. in Philadelphia) - more than five hours after an active shooter was first reported at the health-care clinic, spawning confusion that lasted through the afternoon over whether the gunman was at large or holed up at the medical facility with staff and patients.

Authorities said they haven't determined a motive or whether the shooter had any connection to Planned Parenthood.

"At this point, I have as many questions as you do," Colorado Springs Police Chief Pete Carey said.

"We don't have any information on this individual's mentality, or his ideas or ideology," Police Lt. Catherine Buckley said.

Planned Parenthood released a statement that said it did not know the full circumstances or motives behind the attack, or whether the organization was the target.

Health centers associated with Planned Parenthood have been the target of threats and violence because of the organization's role in providing abortions and lobbying for reproductive rights.

A number of people were evacuated during the standoff - some wrapped in blankets in the blowing snow - to a nearby Veterans Administration clinic.

For several hours, the firing of a long gun was the only indication police had that the shooter was in the building, Buckley said. Officers finally made voice contact by shouting to him and persuaded him to surrender, she said.

Video from the Denver Post showed a tall man in a white T-shirt being led away by police as snow fell on the frigid evening.

With the immediate threat over, authorities turned their attention to inspecting unspecified items the gunman left outside the building and carried inside in bags.

Three officers were shot while responding just before noon to the initial report of shots fired. More than two hours later, the gunman shot another officer in an exchange with police inside the clinic, Buckley said.

The gunman surrendered about five hours after entering the building.

The shots sent people inside the clinic racing for cover. Jennifer Motolinia hid behind a table inside the clinic and called her brother, Joan, who said he heard multiple gunshots in the background.

"She was telling me to take care of her babies because she could get killed," Joan Motolinia said of his sister, the mother of three.

He rushed to the clinic, but a police barricade kept him from getting close.

"People were shooting for sure. I heard someone shooting. There was a lot of gunfire. She was calm, she was trying to hide from those people," he said.

Police inside the building ushered staff and patients to the second floor without saying why, employee Cynthia Garcia told her mother-in-law, Tina Garcia.

Then Cynthia Garcia heard gunshots, but she couldn't tell where they were coming from, Tina Garcia told the Associated Press.

Police cordoned off the clinic, nearby medical offices, and a shopping center. Authorities ordered everyone in the area to take shelter where they were.

Denise Speller, manager of a nearby hair salon, said she heard as many as 20 gunshots in less than five minutes.

She told the Gazette newspaper that she saw two officers near a bank branch, not far from the Planned Parenthood facility.

One of the officers appeared to fall to the ground and the other officer knelt down to help and then tried to get the officer to safety behind a patrol car, she said. Another officer told Speller to seek shelter inside the building.

"We're still pretty freaked out," Speller said by phone while still trapped inside the salon. "We can't stop shaking."

The location of the shooting is less than six miles from the street where a man shot and killed three people before dying in a gun battle with police on Halloween.

This article contains information from the Washington Post.