Former national security adviser Michael Flynn pleaded guilty Friday to lying to the FBI about his contacts with Russian Ambassador Sergey Kislyak and, in an ominous sign for the White House, said he is cooperating in the ongoing probe of possible coordination between the Trump campaign and the Kremlin to influence the 2016 election.

When Flynn was forced out of the White House in February, officials said he had misled the administration, including Vice President Pence, about his contacts with Kislyak. But court records and people familiar with the contacts indicated he was acting in consultation with senior Trump transition officials, including President Trump's son-in-law, Jared Kushner, in his dealings with the diplomat.

Flynn's plea revealed that he was in touch with senior Trump transition officials before and after his communications with the ambassador.

The pre-inauguration communications with Kislyak involved efforts to blunt Obama administration policy decisions — on sanctions on Russia and a U.N. resolution on Israel — potential violations of a rarely enforced law.

Flynn said in a statement: "It has been extraordinarily painful to endure these many months of false accusations of 'treason' and other outrageous acts. Such false accusations are contrary to everything I have ever done and stood for. But I recognize that the actions I acknowledged in court today were wrong, and, through my faith in God, I am working to set things right.

"My guilty plea and agreement to cooperate with the Special Counsel's Office reflect a decision I made in the best interests of my family and of our country. I accept full responsibility for my actions."

Flynn admitted in his plea that he lied to the FBI about several December conversations with Kislyak. In one, on Dec. 22, he contacted the Russian ambassador about the incoming administration's opposition to a U.N. resolution condemning Israeli settlements as illegal and requested that Russia vote against or delay it, court records say. The ambassador later called back and indicated Russia would not vote against it, the records say.

In another conversation, on Dec. 29, Flynn called the ambassador to ask Russia not to escalate an ongoing feud over sanctions imposed by the Obama administration, court records say. The ambassador later called back and said Russia had chosen not to retaliate, the records say.

Flynn admitted as a part of his plea that when the FBI asked him on Jan. 24 — four days after Trump was inaugurated — about his dealings with the Russians, he did not truthfully describe the interactions. But perhaps more interestingly, he said others in the transition knew he was in contact with Kislyak.

Flynn admitted that before speaking with the ambassador, he called a senior transition official at the Mar-a-Lago resort on Dec. 29 "to discuss what, if anything, to communicate to the Russian ambassador about the U.S. Sanctions" and learned that transition members did not want Russia to escalate the situation. And when the ambassador later informed him Russia would not retaliate, Flynn told senior members of the transition team, court records say. The senior transition official is not identified in records, but people familiar with the matter said it is K.T. McFarland, who is now nominated to be the U.S. ambassador to Singapore.

The records say that a "very senior member of the Presidential Transition Team" directed Flynn to contact officials from foreign governments, including Russia, about the U.N. resolution on Israel. That official is also not named, but people familiar with the matter said it refers to Kushner. According to one transition team official, Kushner told Flynn that blocking the resolution was a top priority of the president-elect.

It is unclear what else Flynn might have told Mueller's team about his work for the administration and interactions with Russians or whether that might have significant consequences for the investigation. Flynn is the highest-profile Trump ally — and the first aide who worked in the White House — to face charges in special counsel Robert S. Mueller III's investigation. Trump developed a close rapport with Flynn on the campaign trail, where the general delivered fiery denunciations of Hillary Clinton, including leading a "Lock her up!" chant at the Republican National Convention.

Outside the courthouse Friday, a small group of protesters shouted "Lock him up!" at Flynn as he left the building.

Flynn was forced to resign, but after that, Trump said that his ouster might have been a mistake. Trump's request of then-FBI Director James B. Comey to be lenient with Flynn has also come under scrutiny by the special counsel, and Flynn's cooperation could prove important to Mueller's ongoing probe of whether the president attempted to obstruct justice.

Trump has said previously that he did not direct Flynn to discuss sanctions with the Russian ambassador but that he "would have directed him because that's his job." There is a law — the Logan Act — that bars U.S. citizens from interfering in diplomatic disputes with another country. But the statute has not been used in a prosecution in modern history, and it would not be uncommon for incoming administrations to interface with foreign governments with whom they will soon have to work.

In a statement on Flynn's guilty plea, White House lawyer Ty Cobb said: "The false statements involved mirror the false statements to White House officials which resulted in his resignation in February of this year. Nothing about the guilty plea or the charge implicates anyone other than Mr. Flynn. The conclusion of this phase of the Special Counsel's work demonstrates again that the Special Counsel is moving with all deliberate speed and clears the way for a prompt and reasonable conclusion."

In recent weeks, Trump's attorneys have expected Flynn to plead guilty, particularly after one of Flynn's attorneys, Robert Kelner, said he could no longer communicate about the probe with Trump's lawyers.

Flynn's negotiations to cooperate with Mueller's team began in earnest early last month, according to two people briefed on the discussions. At some point, Mueller's investigators warned Flynn's attorneys that they planned to indict Flynn and also could charge his son, according to the two people, who spoke on the condition of anonymity to discuss private deliberations. Flynn's attorneys, Kelner and Stephen Anthony, provided a proffer of what information Flynn could provide, and then Flynn met with Mueller's team.

The Wednesday before Thanksgiving, White House lawyer John Dowd contacted Flynn's team in a sporadic "check-in" call he made to other defense counsel personnel in the Russia probe every few weeks, people familiar with the matter said. Kelner told Dowd on the call that he could no longer communicate with the White House lawyers. That signaled that Flynn had begun to cooperate or was already actively seeking to cooperate with the special counsel's office, because in either case his lawyers would have a duty to shut off communications with other defense teams.

As part of Flynn's negotiations, his son, Michael G. Flynn, is not expected to be charged, according to a person with knowledge of the talks.

The elder Flynn's case was assigned to U.S. District Judge Rudolph "Rudy" Contreras, 55, a 2012 Obama appointee and veteran federal lawyer who joined the civil division of the U.S. attorney's office in the District in 1994, rising to head the civil division of the Delaware federal prosecutor's office before returning to take the same position in the District in 2006. Contreras also serves on the Foreign Intelligence Surveillance Court.

The plea caps a stunning fall for the general. A native of Rhode Island who grew up in a large family of modest means, Flynn joined the Army officer school and chose early in his career to specialize in intelligence. Among his mentors was Gen. Stanley McChrystal, who praised Flynn's ability in Afghanistan to bond with his soldiers and get results. In 2012, Flynn was named director of the Defense Intelligence Agency but rankled some subordinates there who questioned his temperament and decision-making. President Barack Obama removed Flynn from the DIA post in October 2014.

Though Flynn gave Trump much-needed national security credentials, he had a mixed reputation among other Trump aides, who thought he gave the president questionable information and worried about some of his business dealings.

Flynn has been a major investigative target of the FBI's probe into Russian meddling in the 2016 election. A key question for investigators is whether any Trump associates coordinated with Russian officials to try to sway the presidential race.

Flynn's contacts with Kislyak, who stepped down from his ambassador post in July, are a key issue in the probe, and the plea deal could open new doors for investigators trying to determine what, if anything, Trump knew about such contacts.

Flynn has also come under scrutiny for having a secret financial stake in major foreign policy decisions while advising Trump during the campaign, the transition and the brief period he served in the administration.

In his agreement, Flynn acknowledged lying in his foreign-agent disclosure forms when he claimed that he did not know the extent of the Turkish government's involvement in a contract his firm had obtained and when he claimed that an op-ed he wrote encouraging the U.S. government to expel a rebel cleric and enemy of the Turkish president was at his own initiative.

The maximum penalty for making a false statement is five years in prison, though both sides said Flynn would face a recommended sentence of up to six months in prison under federal guidelines.

The Defense Department inspector general's office, which announced in April that it was investigating Flynn for his failure to report overseas trips to Russia after his Army retirement, has put that case on hold in deference to Mueller's probe.