A Texas deputy who was gunned down during a traffic stop on Friday was remembered as a trailblazer — the first Sikh in his department when he joined 10 years ago.

Deputy Sandeep Dhaliwal, 42, joined the Harris County Sheriff’s Office a decade ago, ushering in an accommodation policy in the department that allowed him to wear a turban and a beard, as is traditional in the religion.

“With our heavy hearts we regret to inform our community that one of members and Harris County Sheriff’s Office Sheriff Sandeep Dhaliwal was shot and killed while performing his duty. Please keep him and his family in your prayers,” the Sikh Officers Association wrote in a Facebook post.

Dhaliwal was slain when a gunman shot him in a “very ruthless, cold-blooded way” during a traffic stop at about 12:45 p.m. near Houston, Harris County Sheriff Ed Gonzalez said.

Dhaliwal had stopped a car in a cul-de-sac and talked with the driver for a few minutes in what appeared to be a routine car stop.

As Dhaliwal was walking back to his police car, the driver ran toward him from behind and shot him point blank in the back of the head, authorities said.

The driver then drove off, but was arrested by another cop nearby. His name was not immediately released.

Dhaliwal was rushed to a nearby hospital, where he was pronounced dead, cops said.

“He was a hero. Deputy Dhaliwal was a trailblazer,” Sheriff Gonzalez said after the shooting.

“There are no words to speak to how heartbroken we are, how devastated,” he added.

With Post wires