A state trooper shot two men in the back seat of a taxi Thursday night on the South Side when one of them pulled out a gun, according to Illinois State Police.

State troopers were conducting an unrelated traffic stop about 8:30 p.m. near West 77th Street and South Vincennes Avenue when a cab pulled up, and the driver flagged down the troopers saying his passengers refused to pay their fare, according to a statement from state police. A source said the two passengers were accused of robbing the driver.

The troopers walked up to the cab to talk to the passengers and saw “what appeared to be a gun” in one of their pockets, state police said. The man “did not listen to any of the Trooper’s commands and then pulled out a gun from his pocket,” and one trooper opened fire after telling him “numerous times to drop the gun,” state police said.

The 25-year-old man accused of holding the gun was shot twice in the lower torso, police said. He was taken to Stroger Hospital in serious-to-critical condition, according to the Chicago Fire Department. He remained hospitalized early Friday with wounds that weren’t thought to be life-threatening, police said.

The other man, 23, was shot in the toe and released into police custody after being treated at St. Bernard Hospital, authorities said.

Fire officials said a trooper was taken in good condition to Northwestern Memorial Hospital for an unspecified injury, though it was not a gunshot wound. State police said no troopers were injured.

A loaded gun was recovered from the scene, state police said.

Police investigate a shooting involving a state trooper Thursday near 77th and Vincennes. Brian Jackson/For the Sun-Times

Police investigate a shooting involving the Illinois State Police Thursday near 77th and Vincennes. Brian Jackson/For the Sun-Times

It was the second Illinois State Police-involved shooting in less than a week. On Saturday, a 15-year-old boy was shot by a state trooper after he tried to run over a trooper with a stolen car, police said at the time.