It all began with a car stop over a flat tire. By the time the episode in North Philadelphia around Temple University’s campus was over Saturday night, a police officer had been dragged by a fleeing car before he shot the driver, who police say had a gun.

Police provided the following account:

At 10:49 p.m. Saturday, two uniformed Philadelphia Highway Patrol officers pulled over a northbound black Toyota Camry on the 1800 block of North Broad Street — between Montgomery Avenue and Norris Street — because the rear tire on the driver’s side was flat, creating “a hazard for other motorists.” The Camry stopped in the center lane of Broad Street and the officers approached it on foot, one on each side.

The officer who asked the 26-year-old driver for his license and registration detected the odor of marijuana coming from inside the Camry. He opened the driver’s door and frisked the driver, feeling and then seeing the handle of a gun in his front left pocket.

The other officer came around to that side and both struggled with the driver for control of the gun. The motorist then shifted the Camry into drive and accelerated.

One officer fell, landing on his back and left elbow. The other, still gripping the Camry, was dragged a few feet up the block as the vehicle continued north on Broad Street, Police Capt. Sekou Kinebrew said Sunday.

The driver pulled out a gun and pointed it at the officer, who then fired his weapon twice, hitting the driver once in the right forearm, police said.

The officer let go of the Camry, which continued north, striking a marked SEPTA police vehicle, occupied by two transit officers, which was northbound on Broad near Norris.

The Camry driver then ran from the vehicle. He was apprehended in a rear alley near the 2000 block of North 15th Street by responding Philadelphia Police officers, Kinebrew said.

During a search of the alley Sunday morning, police found what they believe is the driver’s gun.

Police have not identified him, saying only that he was treated at Temple University Hospital for a gunshot wound to his right forearm. Kinebrew said Sunday afternoon that the man had been released from the hospital and was in police custody. He was expected to be charged by Monday morning, at which time his name would be released, Kinebrew said.

One of the SEPTA officers in the car also was treated at Temple, Kinebrew said. The two Highway Patrol officers did not require medical treatment.

Staff writer Julie Shaw contributed to this article.