Tucson, Arizona - Josh had never felt so angry. A small remark made by his wife triggered an argument that turned into something bigger and, before he knew it, he had smashed and broken his Xbox games console and terrified his wife.

They'd argued a lot since he had returned from military deployment, so she already knew that he was going through a difficult time. But that day was particularly bad and the 31-year-old army veteran was charged with domestic violence after their neighbours called the police.

Even though he wishes that day had never happened, he's glad he had to go through the process. Josh had been deployed in Afghanistan and Iraq. When he returned home after his service, he was a changed man, living in a constant state of anxiety during the day, waking up sweating from nightmares at night. Loud noises triggered flashbacks of the day his army base came under attack.

Standing with his back to the wall in the civic court building in Tucson, Josh told Al Jazeera that he constantly looked over his shoulder when in public spaces, to make sure that no one was sneaking up on him from behind. He also felt depressed, had anxiety attacks, and had attempted suicide several times.

These were all symptoms of post-traumatic stress disorder (PTSD) - a psychiatric disorder afflicting people who have experienced life-threatening, traumatic events.

No one is the same when they come back from their service. One moment, you are in a warzone; the next, you are in an office again and expected to be a civilian. People don't understand the problems and why you are having trouble. But it's not surprising they have difficulty adjusting. Judge Michael Pollard, Veteran Court judge

When Josh was summoned to court over the domestic violence charges, he was introduced to an alternative Veterans Court. The veterans appearing before this court for any misdemeanour are offered the opportunity to follow a six-month programme of psychological treatment instead of punitive punishment. This involves enrolling in a mentor programme and receiving trauma therapy along with substance abuse counselling.

The Veterans Court also has the legal authority to annul any criminal convictions, which ensures that veterans have no criminal record to hinder future job prospects.

The first Veterans Court was opened in 2004 in Alaska. In 2008, they started opening in other states. According to Judge Michael Pollard, there are currently more than 300 veterans courts in the US; only eight states do not have them.

Tucson's Veterans Court was started by Judge Pollard in 2009. Very often, in states without the courts, veterans end up in the criminal justice system and incarcerated for behaviours that are rooted in PTSD. According to research, sustainable improvements are measured among veterans who enrol into treatment within a Veterans Court. Currently, 181,000 veterans are incarcerated across the US.

Fostering trust

In June this year, Josh arrived at the court wearing a clean, freshly pressed shirt to attend a mandatory once-a-month court session. About a dozen other veterans from various backgrounds presented themselves before the judge that day. They had all served in different warzones, from the UN-peacekeeping mission in Bosnia to Somalia to the recent wars in Iraq and Afghanistan.

At every hearing at Tucson's Veterans Court, the judge and the different mentors and counsellors of the court team stand together in front of the bench and state their names and the military branch they served with. They are all veterans themselves.

The idea to establish such a court came to Judge Pollard when he was still working as a magistrate in the criminal court. He started to notice that a high number of the defendants displayed notably disciplined behaviour during hearings, which hinted at their military background.

He decided these veterans should have the right to special treatment in an alternative court system, as already existed for homeless people and the mentally ill.

"I believe they got into trouble in the first place because they were veterans, and had difficulties adjusting to civil society," Judge Pollard explains.

The courts must find their own source of financing. The federal Department of Justice allotted a $4m grant in 2016 to 13 states for the funding of these courts, but this was a one-time grant. In the beginning, Pollard and his team had no funding for the court, but in 2012 he received a grant from the federal government organisation HHS - Health and Human Services. When he lost that grant, Pollard reached out to donors and sponsors in the tech industry in nearby Phoenix.

Pollard, now 72, served in the Vietnam War as a marine. For him, the most difficult part of returning home from the war was the unfriendly reception he received as a result of the anti-war movement in the early 1970s. It took him a few months to find his way again. Although he didn't suffer from life-long PTSD himself, he understands the difficulties other veterans go through.

According to the judge, there has been a recent increase in PTSD among veterans who fought in Vietnam. "I think that's because most of them have finished their careers and fulfilled their life's plans. Now they have a lot of spare time to think," Pollard told Al Jazeera.

Read more about the mental scars afflicting Vietnam's war veterans

Many veterans who served in Afghanistan and Iraq went through a state of hypervigilance because an attack could come from anywhere. In this group of veterans, an estimated 10-18 percent suffer from PTSD.

Josh, who is still in touch with his army buddies living in New York, says they are all dealing with the same difficulties.

The veterans appearing before the judge keep their hands behind their back as they were trained to do in the military. They speak very highly of the judge and the whole team, calling them brothers and sisters. They have all been through the same difficulties, having all served.

The court team uses this understanding to foster trust with the veterans so they can work to resolve the issues that got them into trouble in the first place.

"My clients know I have been going through the same thing. They know I will understand them," 35-year-old Harry Joiser told Al Jazeera. He is a psychotherapist working with the court.

This trust is important for the therapy because veterans can be reluctant to speak out about their problems. "You don't want to be weak. That's what you are trained for in the military," Joiser said.

This reluctance can be dangerous. In the US, an average of more than 20 veterans commit suicide every day - which means more die at home than in combat.

Furthermore, many veterans end up homeless or alone after becoming estranged from their families because of PTSD-related behaviour such as aggression, anxiety, and anger attacks - making them overrepresented among the homeless population in the US.

Keep on truckin'

Recent research indicates that the courts effectively help veterans to reintegrate into communities, obtain steady employment, decrease or cease substance abuse, and improve family relationships and mental health.

"We try to teach them it's OK to have these feelings," said Joiser, referring to the lapses and flashbacks veterans can experience.

Yet despite the high success rate of Tucson's court, with an 83 percent graduation rate, there are still setbacks. Just a few weeks before Josh's court appearance, one of the veterans in the programme committed suicide.

"No one is the same when they come back from their service," said Pollard. "One moment, you are in a warzone; the next, you are in an office again and expected to be a civilian. People don't understand the problems and why you are having trouble. But it's not surprising they have difficulty adjusting."

On his way out of the court, Josh said goodbye to the other veterans, agreeing to join them at the weekly Friday night dinner the court team organises for veterans in a nearby community house. During that evening, the veterans can talk freely to each other about what is on their mind, while enjoying a free meal.

Being in the Veterans Court programme for four months and having had therapy sessions, Josh feels he is more capable of controlling himself. When he does feel an anxiety attack arising, he takes a second breath and tries to pull himself back into the "here and now".

Trying to make ends meet, working a job in a recycling plant while also working as a Lyft taxi driver in his spare time, Josh works hard to keep his life on track.

Since he's been in the programme, his wife told him she could see an improvement in his self-control and decided to stay with him. Her brother was also in the military. He, too, suffered from PTSD, which helps to create a better understanding within the family of the difficulties veterans face.

"It's not just this court; it's that we have Judge Pollard here," said Josh.

"When you show him the respect, you know you're going to get the respect back. You know he's going to work with you. You know he's here to help us to keep on truckin'. It's a mutual agreement."