FARMINGTON — Moments before he was scheduled to go to trial, a San Juan County man accused of shooting at deputies while they investigated a homicide pleaded guilty to three felonies

Martin Martinez, 48, pleaded guilty Wednesday to three counts of aggravated assault with a deadly weapon. The crimes are fourth-degree felonies, each punishable by up to a year and a half in prison.

A jury had been convened and jury selection was about to begin when Martinez signed his guilty plea. He was facing three, third-degree felonies for aggravated assault on an officer and a fourth-degree felony for tampering with evidence. If he was convicted of all four charges, he could have faced up to 10 1/2 years in prison.

On May 28, San Juan County Sheriff's Office deputies arrived at Martinez's property near County Road 2595 between Aztec and Bloomfield.

The deputies were investigating the homicide of Anthony Jacquez, 32, who was found shot to death two days earlier near a mountain biking trail north of Flora Vista. Homicide investigators were looking for the car they believed Jacquez was killed in before his body was dumped.

Deputies Jacob Sanchez and Dave McCall were on a ridge overlooking several buildings on Martinez's property so they could gather information for a search warrant, said Chief Deputy San Juan County District Attorney Brent Capshaw.

"Because they were investigating a homicide, their orders were to try not to be seen," he said.

From the ridge, the deputies saw Martinez point a rifle and fire at them, according to court documents. The shots were filmed on surveillance cameras on Martinez's property. Bullets landed about 60 feet from deputies, Capshaw said.

"We felt at risk of being shot if we stayed in the area," Sanchez wrote in a probable cause statement for Martinez's arrest.

The deputies retreated after Martinez shot at them. Martinez, armed with a pistol, drove an off-highway vehicle to the top of the ridge and again confronted the two deputies and Det. Terry McCoy before he was arrested.

After his arrest, Martinez told officers that he didn't know he was shooting at deputies, and he was trying to scare people off his property when he fired his gun.

Lt. Cory Tanner said deputies would have been justified to use deadly force against Martinez, but he added that "that's not the goal."

Under the conditions of his plea agreement, Martinez will be sentenced to probation to four and half years in prison.

Capshaw said the state agreed to the deal because Sanchez and McCall were not wearing full deputy uniforms or driving marked patrol cars when they were shot at.

"There's always the risk going to trial," Capshaw said. "If I can get a deal for what is reasonable and fair, I tend to do that deal."

Santiago Juarez, Martinez's attorney, could not be reached for comment.

Martinez will remain incarcerated at the county jail while he awaits a separate trial for his involvement in the Jacquez homicide.

Later on the day Martinez shot at deputies, investigators found a car on a property near Martinez's home. It had been burned, taken apart and partially buried, and deputies believe it was the car Jacquez was killed in, according to court documents.

Martin Martinez and his daughter, Sarah Martinez, Richard Winters and Vincent Montoya were all charged with tampering with evidence crimes for their alleged involvement in attempting to destroy the car and evidence in Jacquez's homicide. Those cases are pending.

Gabriel Alcon, 23, was charged with first-degree murder in Jacquez's death. He is set to go to trial next month.

Martin Martinez was also convicted of an assault charge for spitting on a sheriff's office detective when he was incarcerated at the San Juan County Detention Center awaiting trial.

Ryan Boetel can be reached at rboetel@daily-times.com; 505-564-4644. Follow him on Twitter @rboetel.