Laquint H. Cherry, a "local area resident" posted threats on Twitter saying he planned to detonate a bomb planted in the courtroom and wished to die in a shootout with police, Maricopa County Sheriff's Office said in a statement.
Police needed several hours to convince Cherry to surrender as he tweeted more "threatening messages about not being taken alive" and his intent to "kill the cops surrounding him."
Cherry was eventually arrested without incident in a Phoenix hotel room. The statement said investigators found ammunition in the room.
Sheriff Joe Arpaio, whose outsize personality, crackdowns on illegal immigration and prominent "birther" investigation of President Obama have given him a national profile, was apparently also a target of Cherry's threats.
The messages included bomb threats for a new sheriff's headquarters, currently under construction, and "an actual bomb was mailed to the Sheriff, but was intercepted."
"Therefore, our awareness for these kinds of threats is heightened," the statement said.