A Minneapolis man has pleaded guilty to shooting another man to death during a roadside discussion about stolen property.

Ernesto Rivera, 41, admitted on Monday to second-degree murder in Hennepin County District Court in connection with the shooting of Michael E. Rekow on Sept. 9, 2017, just east of Interstate 35W near the intersection of E. 45th Street and Stevens Avenue S.

The plea deal means Rivera did not risk a life sentence if he had been convicted of first-degree murder in a trial, which was scheduled to start Monday.

Instead, Rivera was given a 37½-year term. With credit for time in jail since his arrest, he will serve roughly 24½ years in prison and the balance on supervised release.

“This is an appropriate sentence for a coldhearted murder,” said County Attorney Mike Freeman. “We sought the first-degree indictment because we saw Mr. Rivera as a very real and continuing threat to public safety. He will be in his mid-60s, at the earliest, when he is released.”

Rivera has a lengthy criminal history in Minnesota that includes several felony convictions for burglary, along with convictions for assault, a weapons violation and receiving stolen property.

Rekow was sitting in his vehicle with a woman he was dating when Rivera and another man approached him to discuss stolen property.

Rekow got out of his vehicle and into the back seat of the other man’s van. He began fighting with the two and Rivera shot him. Rekow got back in his vehicle and attempted to drive away but crashed into a sound wall next to I-35W.

When police arrived, Rekow was alone in the vehicle, dead from a gunshot to the head.

Rekow also had been in trouble with the law for many years, often involving theft.

His most daring crime occurred in August 2008, when he commandeered an unmarked Inver Grove Heights squad car and led police on a high-speed chase for several miles while handcuffed until so-called stop sticks placed on the road brought him to a halt, according to the criminal complaint.