For years, a woman named "Mel" mingled with young Muslims in New York, telling them she was a Turkish convert to the faith looking for friends. In reality, she was a cop working for the NYPD.
Her true identity and the full nature of her work remain a guarded secret, but, thanks partly to social media, she may be unmasked as part of an upcoming trial of two women accused of plotting a homemade bomb attack.
By combing the web, attorneys for the two defendants, Noelle Velentzas and Asia Siddiqui, say they have obtained the agent's photograph and learned her real name.
And in recent weeks, they got a judge's permission for a plan to circulate her picture at area mosques in order to build a case that their clients were entrapped by someone fishing for harmless people to lure into a phony plot.
The defense has an obligation "to investigate the case fully," defense attorney Charles Swift said, including probing the activities and background of the police department's mole.
That plan has dismayed police officials, who have been working to scrub any trace of "Mel" from the web.
The NYPD's top counterterrorism official, John Miller, said in a court filing that revealing her identity and widely circulating her picture could jeopardize ongoing undercover investigations.
The case could provide a rare glimpse into how the police department uses informants and undercover investigators to smoke out Islamic extremists. The tactic has long troubled civil rights groups and was the subject of an Associated Press investigation in 2012 about how the nation's largest police department systematically catalogued Muslim neighborhoods, infiltrated Muslim student groups and put paid informants in mosques.
From a law enforcement perspective, the stakes are high for other reasons. Investigators with blown covers are often pulled off the street for good as a precaution. That's because risks of exposure are real, said a former NYPD undercover in major drug and gun trafficking cases and subject of the recent book "Gunz and God: The Life of an NYPD Undercover" who still uses an alias, Stevie Stryker.
"There are people out there who would do anything to take revenge on you," said Stryker, who testified only when courtrooms were closed to the public. "Protecting your identity goes to your house. It's about protecting your wife and family."
Police and prosecutors have revealed in court filings that the undercover agent befriended Velentzas, 29, and Siddiqui, 33, in 2013 and sometimes wore a hidden microphone to record their conversations.
On some of those recordings, made in 2014, Velentzas ranted against the United States and praised the Islamic State militant group. Prosecutors said the pair studied bomb-making and shopped for bomb components, eventually purchasing propane gas tanks, fertilizer and a pressure cooker.
The undercover officer played along, prosecutors said, and talked with them about potential targets.
Velentzas, despite taking the woman into confidence, still had suspicions, prosecutors said in court filings. She used her smartphone to search for the fake name the officer was using, as well as sites with titles like "How to Spot Undercover Police," and "Informants, Bombs and Lessons."
It's unclear how or why the undercover sought to befriend the defendants in the first place.
After news reports on their arrests, several students at Brooklyn College took to Facebook to share their suspicions - later confirmed by a professor - that the same undercover officer, using the name "Melike Ser" or "Mel," had been showing up at student political meetings, former organizer Tom DeAngelis said Monday. Other students told the news site Gothamist that she took a public profession of faith and also circulated at Muslim community centers.
DeAngelis, 23, who graduated last year, said that he encountered her twice and recalled how she once had an exchange in Turkish with one of his friends. Otherwise, "I didn't think anything of it," he said. "She was just there. A lot of us were a little bit naive at that point."
Using news reports and online searches, defense lawyers said they uncovered photos of the woman, her real name, her alma mater and even the names and pictures of some of her close friends.
The police department conceded it was aware of two compromising internet posts: one on Facebook by someone who had a photo of the woman and warned she was an undercover officer, and another on a website with a photo of a wedding she attended in her real life. The department took immediate steps to have them removed.
U.S. District Judge Sterling Johnson ruled late last month that, though he has concerns about the undercover's safety, he can't legally prohibit the defense from using information about her that was found in the public domain. He also rejected prosecutors' request to close the courtroom to the public if she ends up testifying at trial that hasn't yet been scheduled.
The judge instead came up with another protection he said he considered more appropriate: allowing the undercover officer to wear traditional Muslim dress that covers a woman's face.
DeAngelis doesn't remember if she was wearing a hijab or some other covering when he met her. Either way, he said knowing now that "Mel" was a police officer "really messes with you."