A Brooklyn man who shot a stranger on the subway was sentenced to 18 years in prison on Thursday, according to the Brooklyn district attorney's office.

Dequan Hall, 30, was convicted in September of several charges, including second-degree attempted murder, for shooting an unarmed man on the No. 3 train in 2013, Brooklyn DA Ken Thompson said in a statement.

Hall, walking with a burgundy cane, boarded the train at the Rockaway Avenue station with a group of friends on Jan. 10, 2013, and immediately locked eyes with the man. Hall quickly pulled out his gun and pointed it at the victim's head, Thompson said, but the victim slapped it away.

Hall again pointed the gun at the back of his head and the victim again pushed it away. For a third time Hall pointed it directly at the man's face and demanded he get off the train, Thompson said.

The man, fearing he would be shot if he moved, remained on the train and pushed the gun away once more. He was shot just before the doors opened at the Saratoga Avenue station.

Hall then immediately ran off the train.

The victim was shot in the right cheek and the bullet exited his face on the left side by his neck, fracturing his jaw in multiple places, Thompson said. As a result, his jaw was wired shut for a month and he now has a permanent metal plate as well as permanent nerve damage to the right side of his face.

Hall was arrested a day later.

He was sentenced to 18 years in prison