SOUTH PARIS — The man who died after a standoff with police in Mexico on Sunday had a long history with the criminal justice system, serving some 14 years in prison for a variety of offenses.

Steven R. Piirainen, 52, of South Paris died after exchanging gunfire with Maine State Police Trooper Paul Casey and Mexico Reserve Officer Dean Benson, according to a spokesman for the Maine Department of Public Safety.

It was not yet clear if he was killed by police bullets or killed himself, spokesman Stephen McCausland said.

Piirainen allegedly stole a pickup truck in Paris and led police on a chase that ended about 7 p.m. Sunday at a convenience store in downtown Mexico, police said.

Officers from the state police, the Mexico and Rumford police departments, and deputies from the Oxford County Sheriff’s Office surrounded the pickup and closed off the area around the Circle K store on Main Street. Piirainen remained inside the pickup during the standoff and police didn’t confirm he was dead until a short time before 11 p.m. No police officers or bystanders were injured.

The cause of death was to be determined by the state medical examiner, and it had not been released by Monday afternoon.

The Maine Attorney General’s Office is investigating the shooting, as it does in all uses of deadly force by police, and investigators were at the scene of the shooting until just before dawn Monday, McCausland said.

Piirainen’s criminal record includes convictions for burglary, felony theft, domestic violence and aggravated assault, and he faced pending charges of theft, burglary to a motor vehicle and criminal trespass, according to the State Bureau of Identification.

People who knew Piirainen had different impressions of him.

Until about two months ago, he had lived at a relative’s house at 256 Coldwater Brook Road, Oxford.

The tenants who now live at the Oxford house, Dave and Mary Parker, said Piirainen was “not well-liked” in town because of his history of trouble with the law.

“I don’t think anyone was (surprised),” Dave Parker said. “A guy with an arrest record like his has a death wish anyway.”

Parker, 63, said his only recent interaction with Piirainen was on the day he and his wife moved into the Oxford house, and Piirainen helped them unload.

“What I knew of him was enough to lead me to know, I didn’t want to know more,” he said.

The Parkers, who had lived in Norway before moving to Oxford, said Piirainen often would hang out with friends at apartments on Cottage Street in Norway.

Josh Hovan, 25, who lives in an apartment at 19 Cottage St., had known Piirainen for a couple years.

“He was a good guy and a very respectful guy. He’d help anybody out,” Hovan said.

Hovan had seen Piirainen less than a week ago, and he seemed fine.

“I was in disbelief,” Hovan said. The only drug he knew Piirainen to take was prescribed medication for a back injury.

Piirainen had lived in Oxford until recently, when he moved to South Paris to live with his parents, McCausland said.

A man who came out of Piirainen’s parents’ house at 144 Hill St. in South Paris spoke briefly in the breezeway between the single-family house and a detached garage.

The man, who declined to be identified, said the family is requesting a few days of privacy to come to terms with Piirainen’s death.

During his adult life, Piirainen had been sentenced to a total of more than 14 years in prison for different offenses.

Last month, Piirainen was charged with trying to steal from boats in Norway and was charged with burglary and theft, police said. If convicted, he faced another significant stint in prison.