Screenshot by Elinor Mills/CNET

Barrett Brown, who has served as a spokesman for various Anonymous hacking operations, was arrested last night during a raid on his home while he was in the middle of an online chat.

He was taken into custody by the Dallas County Sheriff's Department shortly before 11 p.m. CT but was in the custody of the FBI by midday today, a spokeswoman for the sheriff's department told CNET.

She said she didn't know why he was taken into custody, saying only that no offenses were listed in the report. An FBI spokeswoman said she did not yet have details on the case.

Jay Leiderman, an attorney who is part of Brown's legal team, told CNET that Brown is being charged with threatening a federal agent. Brown is being detained, which is the equivalent of being held without bail, in a federal detention center just outside of Dallas, Leiderman said.

A video of the chat session shows Brown chatting with several people, including one wearing the Guy Fawkes "V for Vendetta" mask that's become the symbol of Anonymous. At one point Barrett gets up from his computer and is no longer visible. Then in the background shouts can be heard, along with what sounds like a scuffle. "Get your hands down!" one voice says. The other chat participants begin laughing and speculating that Brown's house is getting raided.

Earlier that day, Brown appeared in a YouTube video entitled " Why I'm Going to Destroy FBI Agent Robert Smith Part Three: Revenge of the Lithe ," in which he speaks of ruining the agent's life. Brown, whose rant alternates between anger and chuckling, says he is targeting the agent because officials are threatening to charge his mother with obstruction of justice for allegedly hiding a laptop of his that Brown says he himself hid.

"Robert Smith's life is over," Brown says at around 10:40 in the "Destroy" video. "When I say his life is over, I'm not saying I'm going to kill him, but I am going to ruin his life...."

He mentions that he lives in fear because of being a target of the Zetas Mexican drug cartel after he threatened them over the alleged kidnapping of an Anonymous member last year. And he also speaks of shooting and killing law enforcement officials who might raid his home, for fear they might be Zeta operatives in disguise.

Brown, who also says that he's got a "case of the giggles" because he's not taking drugs to help him with opiate withdrawal, ends the video saying: "Frankly, it was pretty obvious I was going to be dead before I was 40 or so, so I wouldn't mind going out with two FBI sidearms...."

The comments appear to be protected speech, attorney Leiderman told CNET. "It looks like he may have a very strong First Amendment defense to this. Barrett engages in a lot of hyperbole, a lot of saber rattling, and he often speaks off the cuff and says sometimes things I don't really think he means," he said. "Without having talked to him it's hard for me to conceive of this as really a threat, as opposed to posturing, puffery."

The next step is to get Brown out of jail, Leiderman said. "Prepare the FreeBarrett hashtag."

Here's the video of the online chat with the raid happening at around 01:30.

And here's the earlier video concerning the FBI agent. Note: It contains foul language.