WASHINGTON ― Former National Security Adviser Mike Flynn was paid more than $500,000 last fall as a foreign lobbyist to help the Turkish government discredit the exiled cleric Fethullah Gülen, according to lobbying disclosure forms that Flynn filed Tuesday with the Department of Justice.

The new documents reveal that Flynn was collecting hundreds of thousands of dollars a month to run an information campaign against Gülen while he was campaigning for Donald Trump by attacking his Democratic presidential rival Hillary Clinton as a corrupt stooge of foreign governments. Following Trump’s surprise victory in November, the president-elect rewarded Flynn’s loyalty by naming the retired lieutenant general as his national security adviser.

On Thursday, White House spokesman Sean Spicer said Trump was unaware of Flynn’s work on behalf of a foreign government when he decided to name Flynn his national security adviser. Spicer declined to say whether the president would have still hired Flynn if he had known.

Ultimately it would be Flynn’s ties to Russia, and not Turkey, that cost him his job in the White House after less than a month. Still unknown in February, when Flynn resigned from the White House, was the nature of his work to benefit the government of Turkey’s autocratic president, Recep Tayyip Erdogan.

This is because Flynn’s lobbying firm told the Senate in September that it was working for a Dutch company called Inovo BV on issues related to State Department and Pentagon funding. It also claimed that the only person working on the Inovo BV project was Flynn’s partner Robert Kelley, not Flynn himself.

Tuesday’s filings, however, told a different story.

According to the new documents, Flynn Intel Group was hired to “perform research” on Gülen and his network of charter schools and to “engage a public relations firm and a filming and production crew to potentially distribute the results of its research.”

Turkish authorities blame Gülen and his millions of followers for a failed coup in 2016 and have jailed thousands for alleged connections to the Pennsylvania-based cleric. The Turkish government wants the U.S. to arrest Gülen and extradite him to Turkey.

Over the three months of the contract, Flynn and his partners enlisted former FBI agents, psychiatrists, retired spies, cyber warriors and cameramen to help them “research” Gülen. The firm also hired Flynn’s son, Michael G. Flynn, and paid him $4,000 for “administrative support” for the project.

Charles Mostoller / Reuters While campaigning for Donald Trump, Michael Flynn was paid to help discredit exiled Turkish cleric Fethullah Gülen, shown at his home in Pennsylvania.

From the beginning, it was clear that the real client wasn’t a Dutch company but Kamil Alptekin, a powerful Turkish businessman with close ties to the Erdogan regime.

Soon after Flynn’s firm began working for Alptekin, they flew to New York to meet Turkish officials, including the minister of energy, Berat Albayrak, who is Erdogan’s son-in-law. At the time, Flynn’s firm believed the meeting was “for the purpose of understanding better the political climate in Turkey at the time, as background for the project.”

At this point, there was little doubt that the work would help the Turkish government achieve one of its chief goals: the extradition of Gülen. Still, the only record of this burgeoning anti-Gülen campaign was a form that claimed Kelley, Flynn’s colleague, was helping a Dutch company navigate Defense Department budgets.

This disconnect between what Flynn’s firm reported and what was really going on is startling, said Alex Howard, deputy director of the pro-transparency Sunlight Foundation.

“If people lobby for foreign countries in the United States, much less if former high-ranking military officers lobby for foreign countries, it’s reasonable to expect them to register [with the Justice Department] at the point they sign a contract,” Howard said in an interview with The Huffington Post.

By taking advantage of a lobbying disclosure system that is riddled with loopholes, Flynn and his firm were able to hide the true nature of their work during a critical three-month period in which Flynn became the most visible national security adviser to Republican candidate Trump.

When asked whether it was concerning that Flynn had been a foreign agent, Spicer said, “This is what he did for a living.”

Even with his busy schedule campaigning for Trump, Flynn still found time to devote to his client.

On Election Day, Nov. 8, Flynn, in an op-ed in The Hill newspaper, called Gülen a “radical Islamist” and argued that, “from Turkey’s point of view, Washington is harboring Turkey’s Osama bin Laden.”

Flynn’s logic in the piece was circular: He defended his claim that Gülen was an extremist by saying that if Gülen weren’t an extremist, then the Turkish government wouldn’t be so angry with him. Flynn concluded by arguing that the United States “should not provide [Gülen] safe haven.”

On Tuesday, Flynn and his firm claimed that Flynn wrote the op-ed entirely on his own and not as a part of his lobbying work on the anti-Gülen campaign. They admitted, however, that Flynn’s op-ed was provided to Inovo BV “for review” in advance and claimed that “no changes, other than technical edits, were made to the op-ed based on feedback from Inovo.”

According to a note added to the op-ed Thursday by The Hill, “neither General Flynn nor his representatives disclosed his lobbying contract when the essay was submitted” to the newspaper.

Following the new disclosure, Alptekin also distanced himself from the firm. “Gen. Flynn never engaged in lobbying work for me or my firm. And I never lobbied or contracted lobbyist on behalf of the Turkish Government,” he tweeted.

Ultimately, it appears that Flynn’s lobbying campaign did not accomplish much, save, perhaps, for lining Flynn’s pockets.

According to the disclosures, Flynn Intel Group was paid a total of $530,000 from Inovo BV over three installments, the last of which was dated Nov. 14, a week after Trump was elected. Over that time, Flynn’s firm claims that it created a “Gülen-themed monopoly graphic” and a few video interviews that were never publicly released.

To this day, Flynn’s op-ed remains the only tangible evidence of the half-million dollars that Turkish anti-Gülen forces paid to Flynn and his partners.

But in the world of foreign lobbying, tangible evidence is merely the tip of an iceberg: The real value lies in future access and backdoor channels.

Two days before Trump was inaugurated, on Jan. 18, Flynn held a working breakfast in Washington with Turkey’s foreign minister, who was visiting the U.S. to celebrate Trump’s inauguration.

Met w/General Flynn,who will assume the position of National Security Advisor, and other officials at a working breakfast in Washington D.C. — Mevlüt Çavuşoğlu (@MevlutCavusoglu) January 18, 2017

Flynn’s firm, meanwhile, still claims, somewhat incredibly, that it “does not know whether or the extent to which the Republic of Turkey was involved with its retention by Inovo for the three month project.”