An FBI agent with top secret security clearance turned rogue and travelled to Syria to marry a wanted Isil fighter she had been assigned to investigate, it has emerged.

Daniela Greene, who worked as a translator for the agency, had used social media to spy on German jihadist Denis Cuspert, a former rapper who had gone by the moniker Deso Dogg.

Cuspert was a prolific online recruiter for the group, who gained a reputation as one of its most brutal foreign fighters. He featured in Islamic State of Iraq and the Levant (Isil) videos threatening the then president Barack Obama and holding a freshly severed head.

But in an extraordinary twist that mirrors the plot of the hit TV series Homeland, which sees CIA operative Carrie (Claire Danes) fall in love with soldier-turned-jihadist Brody (Damian Lewis), the two became close and Cuspert convinced Greene to join him in Syria.

She left in late June 2014 without telling her employers of her plan, according to Federal Court documents seen by CNN.