As a Marine serving in Iraq, Clay Hunt barely missed being killed by a sniper, yet he faced what proved to be more powerful foes after leaving the corps: depression and post-traumatic stress disorder. Mr. Hunt killed himself four years ago, even as he worked to help other struggling veterans.

His death helped galvanize an effort to provide better help for suicidal veterans or those otherwise suffering serious mental health issues. The Senate on Tuesday, by a vote of 99 to 0, passed legislation, named for Mr. Hunt, to improve suicide prevention and mental health treatment programs at the Department of Veterans Affairs.

The bill, which also passed the House unanimously, now goes to the White House, where President Obama is expected to sign it. It signals an unusual level of bipartisan agreement on Capitol Hill, where the measure had died late last year because of a parliamentary maneuver.

According to the latest government data, an estimated 22 veterans kill themselves every day. While many are older veterans, a survey by the Iraq and Afghanistan Veterans of America — which had made the Clay Hunt bill a centerpiece of its efforts to prevent veteran suicides — found that two out of five of its members knew a recent combat veteran who had committed suicide.