DETROIT — A former FBI translator working in Detroit secretly flew to Syria three years ago where she married an Islamic State terrorist leader she was supposed to be investigating.

Daniela Greene, a hired linguist with top-secret security clearance, was working as a translator for the Detroit FBI office in 2014 helping investigate a German citizen who was an ISIL leader in Syria, according to recently unsealed documents in the case.

During the probe, Greene alerted the FBI to several online accounts and phone numbers that the wanted terrorist was using, authorities said. That included Skype accounts that later would be used against her.

But during her investigation Greene fell in love with the man, sneaked off to Syria, married him, and warned him that “the FBI had an open investigation into his activities,” court records show. She quickly became disenchanted — emailing an unnamed person that she had "made a mess of things" — and somehow managed to escape Syria and get back to the United States, where she was arrested.

Her escape from the area unscathed, and with apparently much of that knowledge undisclosed, appears a stroke of luck or a measure of the lack of savvy on the part of the terrorists with whom she interacted,” prosecutors wrote in a 2015 filing.

The wanted man whom Greene married was Denis Cuspert, a German rapper and Islamic State sympathizer who recruited jihadists on the Internet, according to CNN.

Court documents identify Cuspert only as Individual A. And he is alleged to have “announced his sworn allegiance to ISIS and called on Muslim fighters from all over the world to come to Syria to support the group in articles and videos published on Twitter and other online sources.”

Greene knew all this but got involved with him anyway and then lied to the FBI about what she was really up to, the government said.

Lawyer Shawn Moore, who represented Greene, said he could not elaborate on the case, citing security issues and attorney-client privilege.

"Daniela is a smart but naïve woman who got into something that was way over head," he did say in email to the Detroit Free Press.

Greene, who speaks and writes German fluently, worked as a contract linguist for the FBI since February 2011, according to court documents. She began working with the Detroit office in January 2014 in "an investigative capacity."

From the documents, it is unclear how Greene first came into personal contact with Cuspert. But she identified two of his Skype accounts, turning over the information to her supervisors, but kept a third one secret.

Here's what led to Greene's arrest, according to documents filed in the case:

On June 11, 2014, Greene told an FBI supervisor in Indianapolis that she was traveling to Germany to see her family. She filled out the required form and listed “vacation/personal” as the reason for going.

Her declared return date: July 4, 2014.

But she never went to visit her parents. Instead, she went to Syria to marry the terrorist she was supposed to be watching, the FBI said.

She lived with him for 30 days.