A New York State Police trooper was killed in a car crash just outside his upstate barracks while headed to work Tuesday, officials said.

Trooper Jeremy VanNostrand was stopped in traffic outside the State Police barracks in Fonda — about 45 miles northwest of Albany — when another vehicle slammed into his from behind around 7:45 a.m., cops said.

The collision pushed VanNostrand’s vehicle into oncoming traffic, authorities said.

VanNostrand, who had been with the State Police for nearly six years, succumbed to his injuries at Albany Medical Center.

VanNostrand was in his personal vehicle at the time, officials said.

It wasn’t immediately clear whether anyone else was injured or taken into custody.

“The circumstances of the crash are under investigation,” said State Police spokesman Beau Duffy. “At this point, there’s no indication it was an intentional act.”

VanNostrand leaves behind a wife and daughter.