A federal judge on Friday stressed to former national security adviser Michael Flynn the importance of cooperating with prosecutors in order to get a reduced sentence.

U.S. District Judge Rudolph Contreras accepted Flynn's guilty plea to a single felony count for lying to the FBI about two contacts with Russian officials and told Flynn he faces a maximum five years in prison and a $250,000 fine.

Contreras told the former Army general that prosecutors will request less punishment than sentencing guidelines recommend “if and only if” he provides substantial assistance “in the prosecution of another person.”

Court documents say prosecutors anticipate guidelines of between zero and six months in prison and a fine of between $500 and $9,500.

Justice Department attorney Brandon Van Grack said Flynn lied in January about two contacts with then-Russian Ambassador Sergey Kislyak. The contacts occurred on Dec. 22 and Dec. 29, 2016, according to a plea document.

Van Grack said one contact occurred after Flynn “called a senior official of the presidential transition team” to discuss sanctions while that individual was at the Trump-owned Mar-a-Lago resort in Florida. Other transition officials were present, he said.

Flynn immediately called Kislyak and then touched base again with the transition official, Van Grack said.

The other contact occurred after a “very senior member of the transition team” directed an outreach effort regarding a United Nations vote, Van Grack said.

Flynn was fired from his White House job in February after lying to Vice President Mike Pence about contacts with Kislyak.

Van Grack did not indicate wrongdoing on behalf of the unnamed transition officials. Other members of Trump’s orbit, including Attorney General Jeff Sessions, have failed to comprehensively recollect — at least in public — the entirety of their Russia contacts.

Reflecting the apparent haste of preparations, Van Grack corrected himself on two dates, indicating that Flynn made a call to the Russian ambassador on December 23, which was not mentioned in an initial two-page guilty plea document released by Mueller’s office.

Flynn's appearance on Friday comes after special counsel Robert Mueller unveiled a trio of criminal cases in October as part of his probe of Trump campaign links with Russia.

The earlier charges included alleged money laundering and violations of the Foreign Agents Registration Act by former Trump campaign manager Paul Manafort and assistant Rick Gates for work with Ukrainian politicians before the Trump campaign. A campaign foreign policy adviser, George Papadopolous, meanwhile, pleaded guilty to lying to the FBI.

Flynn was not charged with FARA violations for his belated acknowledgment of work for Turkey’s government. Van Grack said, however, that Flynn made “false statements and omissions” in paperwork he filed with the Justice Department in March and Flynn said later in the hearing the prosecutor’s allegations were accurate.

“The plea of guilty is accepted and I find you guilty as charged,” Contreras told Flynn, who had agreed to waive various rights, including to a jury trial and against self-incrimination.

There is no sentencing date yet in Flynn’s case. The judge said Flynn must check in once a week and would not be held in custody ahead of sentencing. He scheduled a status hearing for February 1.