(CNN) -- The dashcam of a Texas sheriff's deputy helped identify his alleged killer, who was arrested within hours of the fatal shooting Friday at a business less than a mile from the scene, authorities said.
Deputy Sandeep Dhaliwal was an observant Sikh and gained national attention after he got permission to wear a turban as part of his Harris County Sheriff's Office uniform. He was conducting a traffic stop when he was shot in the head, Sheriff Ed Gonzalez said.
The shooter fled the scene but authorities identified him by looking at Dhaliwal's dashcam video. They took a photo of the suspect from the dashcam and immediately got it out, Gonzalez said.
Robert Solis, 47, was arrested at a nearby business and is charged with capital murder, officials said. A woman who was in the vehicle with him was also taken into custody.
At the time of the traffic stop, Solis was wanted on a parole violation warrant "for aggravated assault with a deadly weapon dating back to January 2017," Gonzalez said on Twitter.
"He (Solis) ... probably knew he was going to go back to jail and did not want to go back to jail," sheriff's Maj. Mike Lee said Friday, according to CNN affiliate KTRK, when asked about a possible motive.
Authorities arrested Solis at an ice cream shop, where he'd been for nearly half an hour before he was taken into custody, CNN affiliate KPRC reported.
A judge ordered Solis held without bond at a probable cause hearing Saturday morning; Solis was not at the hearing. His next court appearance is scheduled for Monday.
A 'cold-blooded ambush'
The deadly encounter started as a regular traffic stop just before 12:30 p.m. CT in the Copper Brook area of northwestern Harris County, said Lee, the Harris County sheriff's major.
The dashcam video shows Dhaliwal speaking with the driver with "no combat, no arguing," Lee told reporters. The driver's door was open at one point as the deputy and driver were talking.
Dhaliwal shut the driver's door as the driver remained in the vehicle. As he turned to walk back to his patrol car, the driver's side door opened and a man exited the vehicle "almost immediately running with a gun already out," Lee said.
The dashcam captured the fatal moment Dhaliwal was shot from behind in the back of the head, Lee said.
"In a cold-blooded manner, ambush style, (he) shot Deputy Dhaliwal from behind," Gonzalez said. The pistol deputies believe was used to kill him has been recovered, the sheriff said. "It's the worst day, the worst nightmare for any police executive."
The shooter returned to his vehicle and drove away. A resident who was doing yard work nearby heard the gunshots and rushed to help the deputy.
Adrian Garcia, Harris County police commissioner, said Dhaliwal was a beloved deputy.
"This guy had a heart of gold. He treated his brothers and sisters in law enforcement as if they were just brothers and sisters. He thought of them before he thought of himself. He thought of the broader community before he thought of himself," Garcia said.
He leaves a legacy as a trailblazer
Dhaliwal is survived by his wife and three children.
He leaves a legacy as a trailblazer for the department he served for a decade. He was the first member of the Sikh community to become a Harris County sheriff's deputy, officials said.
In 2015, roughly six years after Dhaliwal joined, the sheriff's office made an official policy that allowed him to wear his beard and turban on duty, according to CNN affiliate KTRK.
"As a Sikh American, I felt the need to represent the Sikh community in law enforcement," Dhaliwal said at the time. "It will give me the chance to open up the conversation."
Prior to becoming a deputy, Dhaliwal was an entrepreneur with a trucking business. He found out that the Harris County Sheriff's Office needed someone like him to build bridges with the Sikh community and sold his business. He took lower pay as a detention officer and worked his way up to be a deputy, Garcia said.
Dhaliwal represented the community's diversity and inclusiveness, Houston Mayor Sylvester Turner tweeted.
"He wore the turban, he represented his community with integrity, respect and pride and he was respected by all," Gonzalezsaid.
Sikhism is the world's fifth most popular religion. It is a monotheistic faith that believes in equality and service to others.
There are 25 million Sikhs around the world and about 500,000 in the United States, according to The Sikh Coalition.
A community mourns
In the hours after Dhaliwal's death, residents of the community he served gathered in an impromptu vigil and used social media to honor him.
Online, people shared photos and videos of their encounters with him. One woman sent the sheriff's office a video of Dhaliwal interacting with her deaf son at a restaurant.
"He laughed and joked with all of us and left a bright impression on my son who is deaf," she said, according to the sheriff's office, which tweeted the video.
People gathered Friday night at an outdoor, community-led candlelight vigil in the Copper Brook area, near where the shooting happened.
Gonzalez, the sheriff, stopped by.
"Grateful beyond words to witness the impromptu vigil," he tweeted.
™ & © 2019 Cable News Network, Inc., a Time Warner Company. All rights reserved.