When Machado reenlisted, he automatically received an honorable discharge for his previous service. That reenlistment ended in a less-than-honorable discharge.

"The bonus is supposedly for my service while deployed," he said.

But when he left the Army and applied for his Welcome Home Bonus, the state treasurer denied the benefit.

Machado grew up in Peabody. He enlisted in the Army after 9/11 and deployed to Afghanistan. He earned the Combat Infantry Badge, the Afghanistan Campaign Medal with Campaign Star and the NATO Medal. He later earned an Army Good Conduct Medal, which shows that he had no disciplinary issues in his first three years of service.

"They gotta look at all the circumstances surrounding the situation before they go ahead and start closing doors on veterans," he said.

Among them is Jeffrey Machado. He's one of two Massachusetts veterans now suing state Treasurer Deb Goldberg, saying that they were unjustly denied their bonuses after serving in Afghanistan.

An unprecedented percentage of post-9/11 veterans have received less-than-honorable discharges. Often, it's because of misconduct related to post-traumatic stress disorder or traumatic brain injury. Sixty-two percent of service members separated for misconduct from 2011 to 2015 had been diagnosed with PTSD, TBI or another mental condition.

But thousands of veterans have not received this bonus because of less-than-honorable discharges.

Massachusetts recognizes the sacrifices of those who have been deployed in the military since 9/11 with a Welcome Home Bonus . It's a grant of up to $1,000 each time a service member serves honorably in Iraq or Afghanistan, and $500 to each service member who serves at least six months on active duty.

"They gotta look at all the circumstances surrounding the situation before they go ahead and start closing doors on veterans."

By then, war had taken a toll on him.

"I started having a lot of issues sleeping. Several suicidal ideations and attempts," he explained. "Eventually, I tried going to my unit for help. That kind of fell on deaf ears for awhile. Then, the situation at home starting getting rocky as well. Things just became volatile. I went to seek help from the Army several times, and they just brushed it off, brushed it off, until I had a particular incident with my wife at the time in the car with me."

He tried to take his life.

"She attempted to essentially stop me from running off the road in the vehicle, and I used force to get her away from the steering wheel and kind of subdue her — grabbed her by the throat," he said.

Machado acknowledges that what he did was wrong. He was later diagnosed with PTSD and TBI. The Department of Veterans Affairs found him 100 percent disabled based on those service-connected wounds.

Dana Montalto, an attorney with Harvard Law School's Veterans Legal Clinic, is representing Machado and another Afghanistan veteran from Massachusetts suing for his bonus.

"People can get a less-than-honorable discharge for a whole range of reasons, from really minor misconduct to things that are more serious," Montalto explained. "Common issues that we see for many service members are struggling with mental health disorders after they return from a war zone."

That's what happened to Machado. He was flagged for investigation related to altercations with his wife. He was ordered not to contact her. When he tried to text and call her after being released from in-patient psychiatric hospitalization, his command initiated separation and court-martial proceedings that led to his discharge under "other-than-honorable" conditions. Machado then made a deal.

"I would essentially walk away from the Army with an 'other-than-honorable,' and they wouldn't go forward and prosecute or do anything," he explained. "Which, at the time, sounded like a great idea because, at the time, they had me locked up at the brig when I should have been still in the hospital."

Montalto argues that Machado's final discharge is irrelevant for the purposes of his eligibility for the Welcome Home Bonus.

"The Department of Veterans Affairs has found that their service actually was honorable, and it's actually providing them some health care and supportive services," she said. "It's only the commonwealth that has decided to withhold that recognition in this particular case."

Montalto said only Machado's prior period of service, which the Army had characterized as honorable, should be taken into account for the bonus.

"Both of the veterans who we're working with faced challenges later on in their service that eventually led to what's known as a 'bad-paper discharge,' but that's really not relevant to the case here," she explained. "The fact is that the Massachusetts Legislature chose to reward deployments that were honorably completed, which both of these veterans did."

Montalto estimates that 4,000 Massachusetts veterans are in a spot similar to Machado: They served honorably, were discharged honorably when they reenlisted, and many then struggled to cope with PTSD, TBI or other wounds of war that led them to run afoul of military discipline.

The state treasurer's office is declining to comment, citing the lawsuit.