(Reuters) - An Uber driver accused of fatally shooting six people in Michigan and wounding two others while on the job pleaded guilty to all charges on Monday, after initially blaming the ride sharing company’s app for compelling him to kill.

Jason Dalton, 48, was charged with 16 counts, including six counts of murder and two counts of attempted murder after his nearly five-hour shooting spree on Feb. 20, 2016 in Kalamazoo, about 150 miles (240 km) west of Detroit.

In April 2016, a judge ruled that Dalton was mentally competent to stand trial after psychiatrists determined he understood the charges against him. Two months later, prosecutors said Dalton’s attorney, Eusebio Solis, told them the defendant intended to file a motion to use the insanity defense.

After his guilty plea on Monday, Dalton faces a life sentence without parole, Kalamazoo Prosecuting Attorney Jeffrey Getting said in a statement.

Solis did not immediately respond to Reuters’ request for comment.

Dalton submitted his guilty plea while jury selection was taking place in Kalamazoo County court, where he was standing trial this week.

In March 2016, Dalton filed a $10 million federal civil rights lawsuit against the ride-sharing company after telling investigators that Uber’s app had the ability to “take over” his body and compel him to kill.

He told police that when he pressed a button on his phone screen, the horned cow head of a devil would appear and give him an assignment that he said would “literally take over” his body, local television station WZZM reported.