NEW YORK (AP) - An unemployed computer programmer gave a surprising answer when a police officer asked him for identification one night, authorities said: "Relax. I am a federal agent."
He wasn't an agent. But Hector Xavier Monsegur _ known in the showy-yet-shadowy community of computer hackers as Sabu _ was an FBI informant helping to build a case that would rattle the underground world of Internet saboteurs.
Federal authorities revealed his role in March as they announced charges against five other alleged associates of the worldwide hacking group Anonymous.
All that was still under wraps in February, when Monsegur encountered the officer and ended up arrested on an impersonation charge. A Manhattan state judge agreed Thursday to dismiss the misdemeanor case if Monsegur stays out of trouble for six months.
Monsegur _ the 28-year-old, self-taught programmer who was one of the world's most prominent computer vandals _ wasn't there. A judge excused him from appearing after his lawyer, Peggy Cross-Goldenberg, cited safety concerns. Federal prosecutors have said they were concerned about his security and might enroll him in the federal witness-protection program.
Prosecutors offered the dismissal plan but didn't discuss their reasoning during a brief court hearing. Such offers are somewhat common in misdemeanor cases.
The Manhattan district attorney's office and Cross-Goldenberg declined to comment.
To his neighbors at a Manhattan public housing complex, Monsegur was a young man raising his two nieces after his aunt was locked up in a drug case. But as Sabu, he was disrupting government and corporate websites, federal prosecutors said.
Besides his association with anonymous, he formed an elite hacking group called "Lulz Security" or "LulzSec," authorities said. "Lulz" is Internet slang that can be interpreted as "laughs," "humor" or "amusement."
After Monsegur slipped up by posting something online without masking his computer's identifying information, the FBI arrested him in June, authorities said. He immediately began diligently helping prosecutors monitor communications among fellow hackers and protect computer systems from attack, federal prosecutors said, even as his Sabu persona took a defiant stance toward the government in online postings.
Monsegur secretly pleaded guilty in August to charges that included conspiracy to commit hacking. He faces at least two years behind bars but has yet to be sentenced.
In exchange for his cooperation, federal prosecutors agreed not to prosecute him for various other crimes he admitted committing, including illegal handgun possession and his attempted sale of a pound of marijuana in 2010 and 4 more pounds in 2003, federal court documents show.
Then, while Monsegur was in his apartment building on Feb. 3, an officer asked him for identification, according to a court complaint. It's unclear why the officer was asking, although people leaving and entering city housing developments are often asked for an ID as a security measure.
Monsegur then said he was a federal agent, according to the complaint. He was arrested after the FBI told police he wasn't, the complaint said.
It's unclear whether police were aware then that Monsegur was an informant. It wasn't until a month later that the FBI publicly disclosed that he was Sabu and was cooperating.
At the same time, authorities arrested the five other accused hackers he had helped implicate. Their cases are still open.
Follow Jennifer Peltz at http://twitter.com/jennpeltz