Former Trump adviser Michael Flynn admitted in court Friday that Trump transition officials directed his contacts with the Russians.

As part of a plea agreement, Flynn agreed to cooperate with the federal investigation into the Trump administration's alleged ties to Russia.

The Office of the Special Counsel said Flynn was charged with making false statements about his contacts with Russia’s ambassador to the United States. The office is investigating accusations of Russian meddling in the 2016 U.S. presidential election and potential collusion by Trump’s campaign.

After leaving U.S. court in downtown Washington, D.C., Flynn was met with jeers of "lock him up."

Flynn, who was fired from his White House post in February for misleading Vice President Mike Pence about his conversations with the Russian ambassador, is a central figure in the investigation led by Special Counsel Robert Mueller.

He is the second former senior aide to Trump to be charged in the probe. Mueller’s investigation and several congressional probes into the matter have dogged Trump’s administration since the Republican president took office on Jan. 20.

Paul Manafort, who ran Trump’s presidential campaign for several months last year, was charged in October with conspiring to launder money, conspiracy against the United States and failing to register as a foreign agent of Ukraine’s former pro-Russian government.

Manafort, who did not serve in Trump’s administration, and a business associate who was charged with him, pleaded not guilty.