IRVINE, Calif. (AP) — A man who crashed his Mercedes through the gates of a California jail while driving drunk will spend some serious time behind bars.

Matthew Van McDaniel, 25, of Los Alamitos was sentenced in a Newport Beach courtroom Friday to nine years in state prison for driving recklessly while under the influence of alcohol and assaulting an officer, the Orange County District Attorney's office said.

Early on Jan. 10, McDaniel was driving in his Mercedes S550 with a blood alcohol level of 0.14 percent, nearly twice the legal limit. He lost control and crashed through the gates of the James Musick Correctional Facility in Irvine. McDaniel then punched and broke the nose of a sheriff's deputy from the jail who was trying to restrain him.

Sheriff's spokesman Jim Amormino said at the time it was "the first time somebody tried to break into the jail."

McDaniel pleaded guilty to one felony count of aggravated assault on an officer, one felony count of being an ex-convict entering the grounds of a correctional facility, one misdemeanor count of reckless driving, one misdemeanor count of driving under the influence of alcohol and one misdemeanor count of driving with a blood-alcohol level of 0.08 percent or more.

He had also been convicted of assault with a deadly weapon in 2003, and could have faced much more prison time had he gone to trial.

McDaniel's attorney Anthony Zinnanti, who worked out the plea deal, said it was the only viable option.

"In this case, it was clearly the most practical thing to do," Zinnanti said. My client realizes he has had some issues he needs to address. He looks forward to a period of self-reflection."