PRINCETON — A 56-year-old man who was killed by police Tuesday after holing himself up at a Panera restaurant had told federal authorities last year he'd been in a psychiatric ward and suffered from post-traumatic stress disorder as a result of his military service.

The disclosure came in proceedings over tens of thousands of dollars he owed the federal government, New Jersey 101.5 has learned.

Scott Mielentz was identified by the state Attorney General's office Wednesday as the gunman who led a tense standoff with police for several hours Tuesday.

Authorities said Mielentz, armed with a gun, entered the restaurant in the borough’s busy downtown. Customers and employees quickly cleared out before heavily armed police, state troopers and the FBI swarmed the block.

Investigators have not said what motivated Mielentz. They also have not described the gun he carried, or whether they know how he obtained it.

Authorities also have not explained what caused police to shoot Mielentz. The state Attorney Generals' Office is investigating the shooting, which it routinely does after violent encounters involving troopers or county-level police forces.

Federal bankruptcy records obtained by New Jersey 101.5 on Wednesday provided a glimpse into Mielentz’s troubled life.

In a deposition last year in which he answered questions under oath from Social Security Administration attorneys, Mielentz said he had been admitted to a psychiatric ward “for a bit of time” within the past few years. He did not explain and lawyers did not ask for specifics.

He also said he was on medication and that he suffered from herniated discs and degenerative disc disease, which prevented him from working. All this, he said, had been his reasons for seeking Social Security benefits in 2014.

"I was having difficulty at my job," he said. "Remembering things and my neck and back. I was — it's just a lot of difficulties."

In a filing by his attorneys, it was revealed that he had PTSD and depression dating back to his service as an Army Ranger in Laos during the late 1970s. His lawyer said Mielentz suffered from hallucinations, flashbacks and anxiety and had been treated since 2010.

In June 2014, his wife filled out a Social Security Administration form attesting to her husband's disabilities. She wrote that she had known him for 28 years.

"His depression and anxiety make it hard for him to remember things," she wrote by hand. "He needs constant repeating. He is always tired."

She said he took the antipsychotic Rispiradone and pain medications oxycodone, morphine and and Gabapentin.

On the part of the form that asks if he is able to pay bills, she checked off "no."

"Can't handle seeing the money go to bills. Scares him to see it go. Creates anxiety," she wrote.

When asked how he handles interaction with figures of authority or police, she wrote: "Can get agitated but mostly unnerved."

When asked if she had "noticed any unusual behaviors," she checked yes: "The anxiety creates fear that he cannot explain."

While she details his usual activities — going for walks, visiting the library — she makes no mentions of guns.

Social Security officials, however, say Mielentz was overpaid $29,500 in benefits from June 2014 to September 2015 because he had returned to work before January 2015. The feds say he earned at least $17,900 in consultant work during the time he was on disability.

Mielentz also owed the IRS about $6,800, according to his June 2016 Chapter 7 bankruptcy filing.

The federal government sued Mielentz in October 2016 because his bankruptcy petition tried to wipe out the overpaid benefits he owed Social Security. This past December, Mielentz and the feds reached a deal in which he would be required to pay back $25,000, allowing him to “discharge,” or wipe out, the rest in his bankruptcy.

His bankruptcy filing shows he had $6,670 in assets and nearly $122,500 in debts. Aside from the government, he owed a bulk of his debt to credit card companies, doctors and hospitals in Pennsylvania, Philadelphia and Mercer County, and about $42,900 in student loans.

Court records show he had been living on Princeton Pike in Lawrence — a short drive from downtown Princeton — for about a year after moving from Newtown, Pennsylvania, where he had been living with his daughter since about 2009. He previously lived and worked in Florida, he said.

In the deposition, he said he had obtained a bachelor's degree in information technology about 15 years earlier. It was not clear from the records if he was living with his wife.

In the most recent court filings in the bankruptcy case, Mielentz’s lawyer said his daughter would be testifying as a fact witness to detail her father’s medical condition, “inability to function” and how she had to assist him with basic household tasks such as reading mail and paying his bills.

Mielentz’s lawyer did not immediately return a request for comment Wednesday. New Jersey 101.5 also could not immediately reach known relatives of Mielentz.

Sergio Bichao is deputy digital editor at New Jersey 101.5. Send him news tips: Call 609-359-5348 or email sergio.bichao@townsquaremedia.com.