A Utah man has been arrested on suspicion of shooting an off-duty Los Angeles County sheriff's deputy as he waited in line at a fast-food restaurant, authorities said.

Long Beach police arrested 30-year-old Rhett Nelson of St. George, Utah, on Tuesday and turned him over to sheriff's investigators, Fox 11 reported.

Nelson went into a church Tuesday morning and called his father back home, sheriff’s Homicide Bureau Capt. Kent Wegener said.

NEW YORK WOMAN ASSAULTS SUBWAY RIDER WITH INFANT STRAPPED TO CHEST, POLICE SAY

“In that call, he referred to committing a murder in Southern California,” Wegener said.

The father called police, who stopped Nelson in his car a short time later, he said.

Investigators said they believed Nelson was the man who walked up and shot Deputy Joseph Gilbert Solano in the head on Monday as he stood at the counter of a Jack in the Box in suburban Alhambra.

Sheriff Alex Villanueva said Solano was in grave condition and on life support.

“This is the part of this job that I don’t relish,” Villanueva said. “I always dreaded this would happen. It happened way too soon.”

Solano joined the sheriff’s department in 1999, left in 2000, worked at the Alhambra Fire Department for a year and was rehired by the sheriff’s department in 2006. He was most recently assigned to the custody division, Villanueva said.

Authorities said Solano wasn't in uniform, and the attack appeared to be random and unprovoked.

The shooting was captured on surveillance video and showed the deputy entering the restaurant, ordering food, and then waiting at the counter for his order.

As he was standing at the counter waiting for the food, the gunman approached and shot him once in the head, then left immediately, Wegener said.

CLICK HERE TO GET THE FOX NEWS APP

Officials also said Nelson may have killed another man an hour earlier.

Los Angeles police are trying to determine whether Nelson also drove up and killed another man in that city less than an hour earlier in another apparently random shooting.

Fox News' Travis Fedschun and The Associated Press contributed to this report.

Click for more from Fox 11.