PORTLAND — A Portland man charged with sending threatening letters to Gov. Paul LePage will be held without bail until trial, in part because authorities found a .45 caliber pistol in his desk drawer when they arrested him Friday.

Michael Thomas, 50, a resident of Loring House, an apartment complex for people with disabilities, appeared in U.S. District Court in Portland today as Assistant U.S. Attorney Stacey Neumann argued that he posed a significant risk to the community.

Thomas is accused of mailing three anonymous letters to LePage saying things like he would sacrifice his life to shoot the governor.

FBI Agent Pamela Flick testified that when Thomas was arrested Friday morning he admitted sending the letters and also that if the agents had showed up later than 6:30 a.m., when he had been awake, he would have engaged them in a shootout. She said the handgun was found in his room, unloaded but with an ammunition clip alongside it.

Thomas also admitted sending a letter in 2005 containing white powder to the prep school he attended in Massachusetts, and similar letters to several police agencies in that state, Flick said. He was convicted in 1998 and 1999 of threatening and harassment in association with threats against former classmates who he said bullied him in high school, she said.

Thomas also admitted sending threatening letters to Sen. Joe Lieberman, Wisconsin Gov. Scott Walker, U.S. Rep. Steve Kiing, R-Iowa, and Sens. Olympia Snowe and Susan Collins. Thomas described himself as a liberal Democrat and a communist and said he is a strong proponent of gun rights.

Thomas has been collecting disability payments since 2002 when he was diagnosed with a series of personality disorders including antisocial behavior and paranoia.

He changed his name from Shawn Higgins in 2005 which he said was an attempt to get a fresh start.

Thomas’ attorney, J. Hilary Billings, argued that Thomas should be released on house arrest with an electronic monitoring bracelet because even though he sent threatening letters, he has never been charged with violence against anyone. Billings also said the gun Thomas bought in 2004 in Houlton has never been fired.

District Court Judge John Rich said he decided to keep Thomas in custody in part because previous probation violations showed he could not be counted on to abide by bail conditions.