The Parkside man accused of shooting a Philadelphia police officer in the arm Thursday night was charged Friday with attempted murder and related offenses.

The injured 19th District bicycle patrol officer, Daniel Kostick, was released from the hospital Friday afternoon. His alleged assailant, identified as William Nobblen, 35, remains at Hahnemann University Hospital in serious condition.

Police characterized the case as a drug-related investigation.

A law enforcement source said Nobblen had been driving a van in Parkside around 10 p.m. Thursday when Kostick, on patrol, noticed he was driving erratically with smoke seeping from the van.

Though he lost sight of the van, Kostick later saw Nobblen on foot on the 5000 block of Master Street, police said, and approached him on his bike.

Deputy Commissioner Richard Ross said at a news conference Thursday night that Nobblen turned to Kostick and said, "I don't want to have to do this."

Then, police said, he opened fire.

Nobblen fired several shots, hitting Kostick in his right arm; Kostick was able to fire back and hit Nobblen in the right arm, as well.

Nobblen ran, police said, leaving his 9mm semiautomatic Ruger at the scene. Responding officers found him in a backyard down the block.

Kostick, a six-year veteran of the force, is married with two children. Police said Thursday night he was in good spirits, and a law enforcement source said he was able to speak briefly to officers about the shooting.

Police said Nobblen had an extensive criminal history, with convictions for drug-related offenses and DUI and a guilty plea for retail theft.

In addition to being charged with attempted murder, he faces charges of aggravated assault, firearms violations, and related offenses.