A trail of social media posts led Arizona police to Canada and the apprehension of a fugitive who had been on the lam for 17 years in a negligent homicide case.

Chandler police said the long manhunt for Adan Perez Huerta, 37, ended last week with his arrest in Toronto.

Huerta became a fugitive before he could be sentenced for his role in the death of a 19-year-old woman. She was a passenger in a vehicle he was driving when it crashed and caught fire in Chandler, a Phoenix suburb.

Mugshot for Adan Perez Huerta

Mugshot for Adan Perez Huerta (Maricopa County Sheriff's Office)

Police said Huerta was drunk at the time. The prosecution ended with him pleading guilty.

MAN IN ARIZONA ACCUSED OF BEING AL QAEDA LEADER BY IRAQ: FEDS

Last spring, a Chandler detective was able to track down Huerta by checking social media posts of Huerta’s relatives and associates.

Sgt. Jason McClimans said those posts eventually led to other posts written by Huerta.

“Social media always leaves a digital footprint,” McClimans told The Associated Press in an email.

McClimans said Huerta had been living in Canada under his real name for about a year.

Toronto police turned Huerta over to U.S. Marshals, who returned him to Arizona.

CLICK HERE TO GET THE FOX NEWS APP

Huerta’s defense attorney declined to comment.

The Associated Press contributed to this report.