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.

Two people and a police officer with the University of Colorado in Colorado Springs were killed in the rampage, law enforcement officials said.

Nine other people, including five police officers, were shot and are in good condition, police said. Police say the gunman is in custody. His name was not immediately released.

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

"We don't have any information on this individual's mentality, or his ideas or ideology," 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.

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, Lt. Catherine Buckley said. Officers finally made voice contact by shouting to him and convinced 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 suspect 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 was frustrated because 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."

Shelley Satulla said she saw five or six people put on stretchers and placed in ambulances lined up next to King Soopers shopping center near the clinic.

Mike Pelosi, who works at a deli at a nearby King Soopers grocery store, said he heard over the store's loudspeaker just before noon that nobody could leave the store.

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

Copyright 2015 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.

More From Beach Radio