A Unified Police officer was justified in firing his gun at a man who reportedly shot at him and another officer, the Salt Lake County District Attorney’s Office ruled Wednesday.

Officer Trevor Weeks fired at Justin Gary Llewelyn on Jan. 20, after another officer found Llewelyn prowling around cars in a Riverton apartment complex, near 13400 Dragonfly Lane.

Sgt. Richard Wilson was the first to confront Llewleyn after following “suspicious” footprints he found in the snow near some vehicles. Noticing Wilson, Llewelyn attempted to run away.

When Wilson got about 25 feet behind Llewelyn, he heard several pops and called out over the radio, “Foot pursuit. Shots fired. I think he just shot at me. It sounded like gunshots,” Salt Lake County District Attorney Sim Gill wrote in a letter outlining the investigation.

Weeks drove up on Llewelyn walking down the sidewalk on Lacey Lane shortly after Wilson’s radio call. Weeks told investigators that Llewelyn fired several shots at him, prompting Weeks to stop and jump out of his police truck.

He told investigators he yelled at Llewelyn “in the biggest scariest command voice that I could come up with, ‘POLICE PUT DOWN THE GUN!’ ” according to the letter.

Weeks said he confronted Llewelyn again, telling him to put down his gun, but Llewelyn kept shooting. Weeks returned fire.

The district attorney’s office ruled the shooting justified, concluding in the letter that Weeks “reasonably believed deadly force was necessary to prevent death or serious bodily injury ...”

That confrontation with police set off a series of events as Llewelyn attempted to escape police.

After reportedly firing at Weeks, Llewelyn is accused of breaking into a nearby home and shooting and wounding the homeowner, who had just given Llewelyn the keys to his car.

Llewelyn allegedly crashed and abandoned the vehicle near Blackridge Reservoir, then hid from police with various family members for five days before he was arrested in Spanish Fork on Jan. 25, when a Utah County sheriff’s deputy rammed into the stolen truck Llewelyn was driving.

Llewelyn is charged in 3rd District Court with two counts of attempted aggravated murder, a first-degree felony offense, in addition to first-degree felony counts of aggravated robbery and aggravated burglary, among other charges.

Llewelyn’s mother, sister and aunt have been charged with obstructing justice for refusing to complywith police in their search for the man.