A felon with a violent criminal history was charged Thursday with fatally shooting a man in the back outside an Eagan hotel this week.

Robert L. Baker III, 29, of St. Paul was charged in Dakota County District Court with second-degree intentional murder in connection with the killing Monday night of 29-year-old Maurice A. Anderson, of Minneapolis, outside the Sonesta Suites, just off the Lone Oak Road exit of Interstate 35E.

Baker appeared in court Thursday and remains in custody in lieu of $1 million bail. His attorney was not immediately available to respond to the allegations.

He was also charged Thursday with being a felon in possession of a firearm. Baker was released from prison in May after being sentenced in 2016 for illegal weapons possession. He also has convictions from 2012 for first-degree robbery and second-degree assault with a dangerous weapon.

According to the criminal complaint:

Police arrived outside the hotel about 9 p.m., saw Anderson on the ground and attempted in vain to revive him.

He had 11 gunshot wounds, including one in his head, according to the Hennepin County Medical Examiner's Office.

Officers stopped a vehicle nearby and detained a woman driving and Baker.

The woman told police that three people, two of them with guns, got in their car's back seat and robbed them. She said Baker got out of the car shortly before she heard gunfire. He got back in the car once the shooting stopped and drove off.

Baker told police that one or two of the robbers pointed their guns at him, and he opened fire while giving chase. Officers, however, did not find a gun near Anderson's body.