An Uber driver who went on an hours-long shooting spree in a Michigan city -- killing six people and injuring two others between picking up customers -- pleaded guilty to the murders Monday.

Jason Dalton pleaded guilty to six counts of murder, two counts of attempted murder and eight counts of felony use of a firearm for the 2016 shooting spree in Kalamazoo. The charges carry a mandatory sentence of life in prison with no possibility of parole.

The 48-year-old told the judge Monday he wanted to plead guilty, avoiding a weekslong trial.

MICHIGAN FAMILY OF 5 KILLED IN WRONG WAY CRASH IN KENTUCKY

"I've wanted to do this for quite a while," Dalton told a judge.

Dalton admitted to shooting eight strangers in three separate locations in February 2016 while he was working as an Uber driver, picking up and dropping off customers around Kalamazoo.

He first shot Tiana Carruthers, then 25, several times while she shielded children from the hail of bullets. Carruthers survived the attack, but six others died in the nearly five hours of terror that came next.

A teen also survived the shooting.

Dalton later told investigators he was possessed by a “devil figure” on his Uber app, claiming the platform told him who to shoot, WOOD-TV reported.

CLICK HERE TO GET THE FOX NEWS APP

He was found competent to stand trial and last week dropped an insanity defense.

Defense attorney Eusebio Solis said he advised Dalton not to plead guilty. But he said his client wanted to spare families more grief during a trial.

The Associated Press contributed to this report.