It happened just before 8 a.m. on Sunday in the Town of Islip.
A uniformed Trooper was conducting speed enforcement on the Robert Moses Causeway when he saw a 2009 Red Hyundai Sonata speeding.
When the trooper attempted to pull the car over, the driver sped away.
The trooper chased after the suspect, 49-year-old Allen Nelson, until the car got a flat tire at Pine Street and Montauk Drive in Bay Shore.
Police say that's when Nelson got out of his car and attacked the trooper.
The trooper apparently sustained injuries to his face and neck.
That's when the trooper pulled out his gun and shot Nelson in the shoulder.
The suspect then ran away onto Chenango Drive.
Investigators say he then attempted to carjack a motorcycle from another man.
The trooper found the men in the middle of a violent struggle, and was able to place Nelson under arrest.
The suspect, trooper, and motorcycle driver were all injured, but none of their injuries are considered to be life-threatening.