PHILADELPHIA (AP)  A police officer was shot several times Friday as he approached people suspected of smoking marijuana behind an apartment building, prompting a three-hour manhunt near Philadelphia that halted a dozen Amtrak trains, authorities said.

Folcroft Officer Christopher Dorman, 25, sustained injuries that required at least two surgeries, officials said. He was in critical but stable condition Friday, and police had a suspect in custody.

Police chief Robert Ruskowski wondered aloud at a news conference how somebody “just hanging out, smoking grass at 10 o’clock in the morning … is willing to take your life.”

Donte Island had served about nine years in federal prison on a gun conviction before his release in 2013. His parole officer requested an arrest warrant and revocation hearing in September after Island repeatedly tested positive for marijuana, which he said he used for stress, court records show. But the officer then had trouble finding Island at his listed Folcroft address, and there’s no sign the hearing occurred.

Island was arrested at the same address, an apartment house near the railroad tracks, Friday afternoon after police who had surrounded the building for several hours entered the unit.

Island was being charged with two counts each of attempted murder and aggravated assault. Police said he exchanged gunfire with a second officer after shooting Dorman. His last known defense lawyer, a public defender who represented him in the 2003 gun case, did not immediately return a message after business hours Friday.

Federal officials did not have any immediate information on the parole violations or requested hearing.

Dorman was shot in the face, leg and groin. His police vest deflected several more shots that could have been life-threatening, Ruskowski said.

The shooting took place about a block from the tracks used by Amtrak and a regional rail line. The lines were shut down for more than two hours as police combed the area. About 500 passengers on Amtrak’s Acela and Northeast Regional lines were stopped on tracks nearby, spokesman Craig Schulz said.