A Los Angeles County sheriff's deputy who was shot in an off-duty attack at a Jack in the Box restaurant earlier this week succumbed to his wounds on Wednesday.

Joseph Gilbert Solano, 50, who had been on life support, died in the afternoon, Sheriff Alex Villanueva announced overnight.

Medical staff worked around the clock for two days 'trying to do a miracle but unfortunately that didn't come to pass,' he said.

Rhett Nelson, 30, of Utah, was arrested on Tuesday in connection to the deputy's fatal shooting after he called his father from a church to say he had killed someone.

Los Angeles County Sheriff's Deputy Joseph Solano, 50 (left), died in the hospital on Wednesday, two days after officials say Utah man Rhett Nelson, 30 (right), walked up to him at a Jack in the Box in California and shot him in the head

Los Angeles County Sheriff Alex Villanueva announces Wednesday that Solano has died

Solano was in civilian clothes when he was shot in the head shortly before 6pm on Monday as he was standing behind the counter and waiting for his order at the fast-food eatery in Alhambra.

There's no indication that the gunman knew he was a deputy, Villanueva said.

'The deputy was alerted in the restaurant that someone was following him and that's when he turned to confront it and that's when the shooting happened,' the sheriff said. 'But a motive or rationale from the suspect, that's the million-dollar question.'

There were several customers inside the restaurant during the shooting, officers said. The gunman was seen driving away from the crime scene in a 2006 white Kia Sorento SUV with paper plates.

Solano's son, girlfriend, mother and other family members were at a hospital news conference.

Los Angeles Police Department officers salute a coroner's van transporting the body of Deputy Solano Wednesday in Los Angeles

Family, friends, colleagues and others walk in a procession behind the coroner's van

Relatives of Solano console one another after a news conference announcing his death,

Villanueva, right, talks to Julieanna Loza, left, longtime girlfriend of Deputy Solano, and Solano's stepdaughter Jessica, center, Wednesday

'He was a really good dad,' said his weeping son, Matthew Solano. 'Continue to pray for him and my family, please.'

Solano joined the Sheriff's Department in 1999 after earning an Associate of Arts degree from Pasadena City College. He later left the department to work for a year for the Alhambra Fire Department before returning to the sheriff's department in 2006. Most recently he was assigned to the department's custody division.

Villanueva told reporters that Solano is a family man, well-liked by everyone who worked with him and is the sole support of his mother after his father recently died. He was off duty and running an errand for his mother when he was wounded Monday.

'He was taking his mother's vehicle to be serviced at the Jiffy Lube, which is was right next door to the Jack in the Box,' Villanueva said.

Solano first joined the sheriff's office in 1999, took a break, then was rehired in 2006

The suspected gunman's family in Utah has said Nelson suffers from mental illness and an opiate addiction.

Investigators said Nelson also is suspected of shooting a 30-year-old man standing on a Los Angeles street about an hour before Solano was killed. Both shootings appeared unprovoked and may have been random.

Meanwhile, the San Diego Police Department, the San Diego County Sheriff's Department and the Carlsbad Police Department issued a news release Wednesday saying that Nelson is being investigated in connection with a series of five armed robberies of convenience stores that occurred in the area June 7 through Sunday.

In each robbery, the suspect wielded a handgun and demanded cash, the release stated. The crimes occurred in San Diego, Lemon Grove and Carlsbad.

Before the possible crime spree began, however, Nelson's family contacted St. George police in Utah on May 27 and said he'd left their home 'without any specific reason' with a gun but they did not think he was suicidal or a danger to anyone else, Capt. Mike Giles said.

'He made a statement to them or somehow communicated he wanted to make it on his own or die,' Giles said.

They formally reported him missing the next day and said they believed the gun was for self-defense. It was not immediately known who owned the weapon.

Police said the suspected gunman, later identified as Nelson, was wearing a hat and a burgundy shirt (left) during the shooting but later changed into all black (right)

Nelson's family reported him missing in Utah on May 27, a day after he had left their home 'without any specific reason' with a gun, which they thought was for self-defense

Nelson has a history of mental illness and a history of opiate abuse, though he had been clean for about six months, according to statements from his father, Bradley Nelson. The family is 'devastated beyond words' by the attacks and is cooperating with authorities.

'We believe we made every effort to help Rhett and bring him home safely without harm to himself or others, but despite our best efforts we were unable to locate him before this horrific act,' the statement said.

On June 4, Nelson called his family from Rancho Santa Margarita in Orange County, Giles said. They still believed he was safe and police removed him from a missing persons database the next day.

On Wednesday, the Los Angeles County Sheriff's Department released Nelson's booking photo as part of an effort to seek any additional victims. Homicide investigators believe he may have been involved in other crimes in California.

Giles said no recent crimes involving Nelson have been reported to St. George police.

The Salt Lake Tribune reported that Nelson didn't have a violent criminal history in Utah but had previously pleaded guilty to driving with a 'measurable amount' of a controlled substance in his body and guilty to underage alcohol offenses.

The family used to live in Orange County but moved to St. George 14 years ago when Rhett was a teenager, said Michelle Tennant Nicholson, a publicist for Bradley Nelson, who is a published author.