An Army veteran has been charged with threatening to shoot his wife and other people at the U.S. Capitol, where his wife works.

Michael Bogoslavski, 33, was arrested Monday after he told his wife over the phone and via text message that he planned to shoot her and other people who got in his way, according to court documents. His wife is a Senate staffer and was inside the Capitol at the time he allegedly made the threats. He also told his wife, "I'm going to die suicide by cop," the documents show.

Bogoslavski never approached the Capitol after the threats were made. He was arrested outside his home in Cheverly, Maryland, a suburb of Washington, and told investigators he had been at a gym in Maryland when he sent the text messages. Authorities said they seized two handguns and ammunition from Bogoslavski's house.

According to the documents, Bogoslavski told investigators that he suffers from post-traumatic stress disorder and was struggling to readjust to civilian life. Bogoslavski is a 9-year Army veteran who served two tours of duty in Iraq and another tour in Afghanistan. He retired from the Army in 2013.

He made an initial appearance Wednesday in federal court in Greenbelt, Maryland, and was ordered detained pending trial. He was represented by a federal public defender, who did not immediately return a message seeking comment on Thursday.

According to the documents, Bogoslavski's wife showed the threatening text messages to a Capitol police officer, who then listened on a speakerphone when he called his wife and repeated the threats. The officer then alerted law enforcement to find him. U.S. Attorney Rod Rosenstein praised the police agencies involved for their quick response.

"Their efforts in this case may have prevented a tragic outcome," Rosenstein said in a written statement.