The man who died in a car fire and explosion in front of the Kitchener courthouse last month was involved in a family legal dispute at the time of his death, court documents show.

The documents obtained by CTV News Kitchener also allege he had a history of mental illness and that he was inconsistent in taking his medication.

The man has been identified as 35-year-old Keith Andrew Sandford.

Court documents show Sandford was engaged in a family court matter with his estranged wife over the custody of their two children. The children and their mother cannot be named due to a publication ban.

FIRE CAUSED BY INCENDIARY DEVICE

On Aug. 14, a vehicle in front of the Kitchener courthouse caught fire and exploded. Witnesses at the time told CTV News Kitchener there was a man inside the vehicle and some bystanders tried to get him to safety.

"A couple of my coworkers ran over there and took a look inside, and there was a body inside," witness Mike Sylvester said in the hours after the explosion. "It was engulfed in flames so they couldn't do anything."

Police confirmed later that day that the man inside the vehicle had died.

Sandford was the registered owner of the car.

Police initially believed an improvised explosive device caused the fire and subsequent explosion, but subsequently indicated it was caused by an incendiary device.

"The fire is believed to have been intentionally set and no suspects are being sought," a press release issued by Waterloo regional police on Aug. 17 said.

The explosive disposal unit was called in to help clear the scene on Aug. 14. Police also searched two residences believed to be connected to the man inside the vehicle.

“I can’t speak to who created it, but it appears that the male who is deceased is responsible for this explosion," Supt. Eugene Fenton told reporters at a press conference that evening.

Police said there was no further risk to public safety.

FAMILY DISPUTE IN COURT

According to police records included in the court documents obtained by CTV News Kitchener, Sandford was arrested and charged for assaulting and threatening his now-estranged wife in June of 2018.

Court appearances on the matter began in June and lasted until September of that year.

During that time, Sandford wasn't supposed to have any contact with his estranged wife. However, the documents say he reached out to her through email, text message and in person during those months.

In September of 2018, he was found guilty of one count of assault and sentenced to three years' probation.

The judge gave Sandford credit for pre-sentencing custody. He was also given a five-year ban on possessing firearms, crossbows, ammunition or explosive substances.

Sandford had been involved in matrimonial litigation for two years at the time of his death. A restraining order was put in place in August of 2018 that barred him from attending his wife’s home or workplace.

Court documents show that Sandford lost access to his children on Aug. 20 of that year, and had no access again until he was granted supervised access on Nov. 5, 2019.

HISTORY OF MENTAL ILLNESS

The documents indicate Sandford was diagnosed with schizoaffective disorder in 2012, which manifested as hearing things in his head, extreme mood swings and violent behaviour.

The records also allege that he didn't take his medication consistently.

Sandford had been on CPP disability since 2014 due to rheumatoid arthritis, the documents also reveal.

Sandford had been receiving counselling treatment at a facility in Waterloo.

The coroner's office has not officially identified the man who was found dead in the vehicle. The post-mortem report is expected soon.

Police said the investigation is no longer criminal in nature.

With reporting from Natalie van Rooy