But authorities said he had been unemployed in recent years.

Mr. Monsegur was active in computer and hacking circles as far back as the late 1990s, and started a group for local programmers in 2002. “My name is Xavier,” he announced, inviting others to join and “integrate their knowledge into one big mass of hairy information.”

He soon came to embrace strong antigovernment and anticapitalist ideologies that steered him into the hacking world.

In what was identified as a question-and-answer interview with Sabu published in New Scientist magazine last year, he said that he became a hacktivist when he was 16. He said he became disturbed that the Navy was using Vieques Island in Puerto Rico as a bombing range for exercises, and that he helped disrupt communications. In 2010, he said in the interview, he was drawn to Anonymous, a leaderless, antiauthoritarian movement that has taken up a variety of political causes. The catalyst, he said, was his outrage over the arrest of Julian Assange, founder of WikiLeaks, the whistle-blower site.

In particular, he became a leader of a splinter group, Lulz Security, or LulzSec, which claimed to attack computer security companies for laughs, or lulz, rather than for financial gain.

Describing himself, he said in the interview, “I’m not some cape-wearing hero, nor am I some supervillain trying to bring down the good guys. I’m just doing what I know how to do, and that is counter abuse.” For his online handle he chose Sabu, adopted from a former professional wrestler.

In 2010 and 2011, according to court documents, Mr. Monsegur participated in a relentless string of online attacks against companies and governments. Targets included Visa, MasterCard, PayPal and Sony. He also played a role in attacks on computers belonging to the governments of Tunisia, Yemen, Algeria and Zimbabwe, as well as those of the United States Senate.

Though he was self-taught, Mr. Monsegur was probably among the most skilled technologists in the bunch. As the “rooter,” federal authorities say, he was in charge of identifying vulnerabilities of LulzSec targets and creating the attack strategy.