A man shot and wounded five people, including his girlfriend's 2-year-old grandson, and then turned himself in less than an hour later and confessed, police said.

Mark Q. "Mustafa" Galloway, 39, called police while he fled from the scene of the shooting early Sunday, said Lancaster police Chief Sam Gatchell.

He walked into the Lancaster County Prison, where he admitted to shooting his girlfriend, Tameka Rodriguez, 35, three of her family members and her daughter's boyfriend, authorities said.

"The defendant stated, 'I did it,' and asked, 'How's Tameka doing?"' when interviewed at the prison, according to the arrest affidavit. He later admitted to all five shootings, police said.

The police chief said Rodriguez recently moved back to Lancaster after she and Galloway had problems. Witnesses told police the two began dating last summer.

"She wasn't hiding from him. They were interacting, but things went bad at some point," Gatchell said.

The five were shot outside the front door of a home about 6 a.m., police said.

Rodriguez and her mother, Betty Jane Hogue, 54, who was shot multiple times, were being treated at a hospital, police said.

Also shot were Rodriguez's daughter, Juanita Rodriguez-Rose, 19; her son, Zymir Rodriguez-Rose, 2, and her boyfriend, Luis Martinez-Lopez, 29, police said.

"When you shoot somebody more than once, obviously you mean business," Gatchell said. "And this guy wasn't aiming at their legs."

The suspected weapon, a 9 mm semiautomatic handgun with an altered or obliterated serial number, was recovered from a trash can, investigators said.

Galloway is charged with four counts of attempted homicide, five counts of aggravated assault and firearms violations. He is being held at Lancaster County prison on $1 million bail.

It was not clear whether he was represented by a lawyer on Monday.