Sean Duvall, center, is greeted by a host of veterans offering support as he enters the Poff Federal Building in Roanoke Va. where he was having a hearing at the Federal Court House, Monday, Feb. 27, 2012. (Eric Brady/AP)

Sean Duvall, the Navy veteran charged with fabricating a homemade gun after calling a suicide hotline last year, would avoid prosecution if he completes court-mandated counseling under an agreement reached in federal court Monday.

Duvall, a 45-year-old Persian Gulf War veteran who lives outside Roanoke, was charged with four counts related to the manufacturing of the weapon after calling a suicide crisis hotline run by the Department of Veterans Affairs in June.

The case outraged veterans groups, who said the government should not prosecute those seeking help. They feared that Duvall’s prosecution could have a chilling effect on distressed veterans at a time when they are committing suicide at a rate of 18 per day.

And they were flabbergasted that the man in charge of the office pursuing the charges against Duvall was Timothy Heaphy, the U.S. attorney for the Western District of Virginia, who is the son-in-law of VA Secretary Eric K. Shinseki, an advocate for helping troubled veterans rather punishing them.

Prosecutors initially argued that they had every right to charge Duvall, who admitted to being armed with a gun when he called the hotline from the campus of Virginia Tech. But during a hearing Monday, the government changed course and recommended that Duvall be admitted to counseling overseen by a new Veterans Treatment Court. If completed, the charges, which carried a prison sentence of up to 40 years, would be dropped.

Sean DuVall, on right, at his graduation from Navy training in the early 1990's. Last year, he was a homeless veteran contemplating suicide when he called the VA suicide hotline and got help. (Family photo/PHOTO COURTESY OF SEAN DUVALL)

After the hearing, Duvall, a graduate of Gar-Field High School in Woodbridge, said he was thankful for the chance to continue putting his life back together. But the veteran, who enlisted in the Navy in 1991 and deployed to the Persian Gulf and off the coast of Somalia before being honorably discharged in 1995, said he was “confused as to why they came after me.” He assumed that the VA hotline was confidential, as advertised.

He also said he was concerned about “the veterans that are coming back [from Iraq and Afghanistan]. I know it’s going to be rough for them.”

Duvall, homeless and unemployed, had been wandering the streets for a week before his call to the crisis hotline, according to court documents. He was despondent and reeling, he said, from the death of his father.

In his backpack, he carried a final note to his family, a letter confirming his eligibility to be buried in the Southwest Virginia Veterans Cemetery and a homemade gun fashioned from a pipe. While on the campus of Virginia Tech, where he had worked previously as a part-time cook, he called the VA’s suicide hotline shortly after midnight and told the counselor he was going to kill himself.

A police officer who arrived a short time later took Duvall, a divorced father of two, to a psychiatric facility, where he was treated for depression.

But a week later he was charged by state authorities with carrying a concealed weapon without a license. Eventually, those charges were dismissed so that the U.S. Attorney’s Office could prosecute the case in federal court.

During Monday’s hearing, Assistant U.S. Attorney Donald Wolthuis said authorities were concerned that an armed and mentally unstable person was on the campus of Virginia Tech, the site of a massacre in 2007 in which 32 people died and two dozen were wounded before the gunman killed himself.

Wolthuis also said Duvall’s criminal history — which included public intoxication, driving while intoxicated and destruction of property — also factored in to the decision to charge him.

Heaphy said the fact that Duvall was a veteran didn’t register with him at first. He said that prosecutors were focused more on the fact that Duvall had taken a weapon onto Virginia Tech’s campus.

“That he was a veteran was never really a focus,” said Heaphy, whose father in-law is a former Army chief of staff.

After Heaphy reviewed the case, which received widespread media attention, he said he thought that “maybe we ought to take a deep breath.” The veterans court, he said, would help Duvall fix “the underlying issue that led to the commission of this crime.”

Asked whether he should have referred Duvall’s case to the veterans court at the beginning, he said he wasn’t sure. “I can’t say I would have done it differently,” he said. “I do think there is a value in demonstrating how serious law enforcement is at Virginia Tech.”

He said Duvall’s case was the first felony referred to the Virginia veterans court, which typically takes misdemeanors. Veterans courts are modeled after drug courts and are a relatively new way to help veterans get substance abuse and mental health treatment. If the programs mandated by the court are completed, charges are often dropped.

Under the deal approved Monday, Duvall will be required to appear in the veterans court monthly to update the judge on his progress. If after six months he continues to show improvement, the charges would be dropped.

About a dozen veterans came to the hearing Monday to show support for Duvall. Dan Karnes, president of the Roanoke Valley Veterans Council, said he was angry that the charges were ever filed. Sending Duvall for treatment “is what they should have done from the beginning,” he said.

Duvall, though, said he wasn’t angry. The call to the crisis hotline, he said, saved his life. The counselor on the other end of the line, he said, “talked me through a very difficult time.”