Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Former national security adviser Michael Flynn was attending secret intelligence briefings with then-candidate Donald Trump while he was being paid more than half a million dollars to lobby on behalf of the Turkish government, federal records show.

Flynn stopped lobbying after he became national security adviser, but he then played a role in formulating policy toward Turkey, working for a president who has promised to curb the role of lobbyists in Washington.

White House spokesman Sean Spicer on Friday defended the Trump administration’s handling of the matter, even as he acknowledged to reporters that the White House was aware of the potential that Flynn might need to register as a foreign agent.

When his firm was hired by a Turkish businessman last year, Flynn did not register as a foreign lobbyist, and only did so a few days ago under pressure from the Justice Department, the businessman told The Associated Press this week.

Attempts by NBC News to reach the Turkish businessman, Ekim Alptekin, were unsuccessful Friday.

Price Floyd, a spokesman for Flynn, said the retired general would have no comment.

Flynn was fired last month after it was determined he misled Vice President Mike Pence about Flynn’s conversations with the Russian ambassador to the United States. His security clearance was suspended.

Related: Trump National Security Adviser Pick Flynn Has Medals — And Baggage

When NBC News spoke to Alptekin in November, he said he had no affiliation with the Turkish government and that his hiring of Flynn’s company, the Flynn Intel Group, had nothing to do with the Turkish government.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But documents filed this week by Flynn with the Department of Justice paint a different picture. The documents say Alptekin "introduced officials of the Republic of Turkey to Flynn Intel Group officials at a meeting on September 19, 2016, in New York."

In the documents, the Flynn Intel Group asserts that it changed its filings to register as a foreign lobbyist "to eliminate any potential doubt."

"Although the Flynn Intel Group was engaged by a private firm, Inovo BV, and not by a foreign government, because of the subject matter of the engagement, Flynn Intel Group's work for Inovo could be construed to have principally benefited the Republic of Turkey," the filing said.

The firm was paid a total of $530,000 as part of a $600,000 contract that ended the day after the election, when Flynn stepped away from his private work, the documents say.

During the summer and fall, Flynn, the former director of the Defense Intelligence Agency, was sitting in on classified intelligence briefings given to Trump.

Spicer acknowledged Friday that Flynn’s lawyer called the Trump transition team inquiring about whether Flynn should amend his filing to register as a foreign agent.

Related: Michael Flynn Resigns As National Security Adviser

"That wasn’t the role for the transition," Spicer said. "This was a personal matter, it’s a business matter."

He did not explain whether anyone in the Trump operation dug into Flynn’s lobbying work.

It was well known that on Election Day, Flynn authored an op-ed in the Hill, a Washington newspaper, in which he lambasted Fethullah Gülen, a Turkish cleric residing in Pennsylvania who is blamed by the Turkish government for fomenting a July coup attempt there.

Previously, Flynn had seemed to praise the coup attempt.

According to the Justice Department filing, Flynn’s firm was hired to gather information about Gülen, and to produce a short film about its investigation.

"Flynn Intel Group was tasked to perform investigative research for a specified scope of work using its laboratory team of senior defense, diplomacy, development, and intelligence professionals over a three-month period," the filing said. "Flynn Intel Group was to retain an experienced filming and production crew in order to develop a short film piece on the results of its investigation, and a public affairs firm to utilize for public affairs as needed. Flynn Intel Group held weekly calls with the client to report engagement progress."

Even some Republicans were wondering how the White House allowed Flynn to take one of the most sensitive jobs in the government.

"Makes you wonder if an adequate background check has been done," Rep. Steve King of Iowa said on MSNBC. "I think we need to know a lot more."

Ethics experts say more information is needed to know whether Flynn may have run afoul of any conflict of interest rules. His receipt of a large sum of money on behalf of the Turkish government may have meant he should have avoided specific decisions regarding Turkey, but the details would be crucial.

It wasn’t immediately clear Friday whether Flynn recused himself from any matter while he was national security adviser, or whether he directly participated in decisions that had an impact on Turkey.