MILTON — A Navarre man was convicted Thursday night of principal to attempted murder and robbery with a firearm.

According to a press release form State Attorney Bill Eddins' office, Cody James Gomez's conviction stems from an incident on March 23, 2017, when he and co-defendant Jonalbert Vidal went to the home of William Johnson in Navarre to buy marijuana. 

Evidence from a cellphone associated with Gomez showed he planned to rob Johnson. When they arrived at Johnson's home, Gomez and Vidal asked him to weigh the marijuana. Vidal then shot Johnson once in the face, and he and Gomez fled without the drugs, the State Attorney's Office said.

Johnson told investigators immediately after the shooting that Gomez had come with his friend to buy drugs. Gomez and Vidal were caught in Okaloosa County on two days later, the press release said.

Vidal pleaded no contest to attempted second-degree murder with a firearm and attempted armed robbery with a firearm and was sentenced to 25 years in prison.

Gomez was convicted of principal to attempted second-degree murder with a firearm and principal to attempted armed robbery with a firearm. He faces up to 30 years in prison on the attempted murder charge and up to 15 years in prison on the attempted robbery charge, the release said.

Santa Rosa County Circuit Judge Darlene Dickey is scheduled to sentence Gomez on March 28.