Former FBI Director James Comey. (YouTube)

(CNSNews.com) -- Emails obtained by Judicial Watch through the Freedom of Information Act (FOIA) show that James Comey, even though he had been fired from his FBI director position by President Trump on May 9, 2017, was still communicating and receiving guidance from top FBI officials about his pending June 8 testimony before Congress, advice that included him consulting with Special Counsel Robert Mueller before speaking to Congress.

Comey, when he was still the FBI director, leaked memos to the New York Times that he believed would trigger the appointment of a special counsel to investigate the president. That tactic worked, as former FBI Director and Comey-friend Robert Mueller was appointed special counsel on May 17, 2017.

The emails obtained by Judicial Watch from the Department of Justice and FBI show that Comey "was advised by FBI officials in May 2017 to consult with Special Counsel Robert Mueller prior to testifying before any congressional committees regarding Russian meddling in the 2016 presidential election and his firing as FBI director," said the watchdog group in a statement.

Judicial Watch President Tom Fitton. (YouTube)

"The documents obtained by Judicial Watch are the first to reveal that high-ranking FBI officials helped Comey coordinate his testimony with Mueller," reads the statement.

Judicial Watch President Tom Fitton added, “These documents show that James Comey, who was fired by the president, nevertheless had easy, friendly access to the FBI as he prepped his infamous anti-Trump testimony to the Senate. This collusion led to Comey’s attacking President Trump and misusing FBI records as part of a vendetta against the president.”

Among the documents is an email chain from May 18 and 19, 2017, with the subject line "Future testimony." (Comey had been fired from the FBI on May 9, 2017.) In the chain, then-FBI Chief of Staff James Rybicki, then-Deputy FBI Director Andrew McCabe -- who was fired in January 2018 by the DOJ for lying to FBI investigators -- Assistant FBI Director Gregory Brower, and James Comey discuss Comey's pending testimony.

On May 18, Comey told Rybicki that he had agreed to testify before the Senate Select Committee on Intelligence (SSCI) on June 8, 2017. He further wrote, "Last, would you please tell OGC [Office of the General Counsel] that I would like to be able to review any documents authored by me or on which I am copied that will be produced to SSCI in connection with my testimony and would like the opportunity for that review before I testify."

President Barack Obama announcing that James Comey will be the new FBI director, replacing outgoing FBI Director Robert Mueller, September 4, 2013. (YouTube)

In a May 19 email, 11:49 a.m., Comey states that he just spoke with "Senators [Richard] Burr and [Mark] Warner" about the pending hearing and, "I asked them not to announce it until I check with FBI/DOJ to see if you want to discuss anything before they do that."

"I told them I had asked for guidance on any institutional prerogatives and for the opportunity to review any documents FBI has produced that relate to me," wrote Comey.

Later on May 19, 4:11 pm, Rybicki wrote to McCabe, FBI Deputy Director David L. Bowdich, former FBI General Counsel James A. Baker, FBI Assistant Director Brower, Section Chief Elizabeth Beers and other people whose names are redacted. In the email, Rybicki states,

"Please see a DRAFT response to Director Comey (below). I will hold pending further direction….

"Director:

"In response to your emails below we have consulted with executive management here, including the General Counsel, and recommend the following:

"1. That your counsel convey any acceptance or declinations to invitations to testify directly to the Committees.

"2. That your counsel consult with Special Counsel Mueller to determine the timing of any such testimony and, [Emphasis added.]

"3. The Office of General Counsel stands ready to discuss with you in consultation with the Department of Justice and the Special Counsel, institutional privileges or prerogatives that may be presented by any such testimony."

Former FBI Deputy Director Andrew McCabe, who was fired in January 2018 for lying to FBI investigators. (YouTube)

Citing a Fox News report from June 7, 2017, Judicial Watch said that "Comey met directly with Mueller presvious to his June 8, 2017 testimony before the Senate Intelligence Committee. Sources said that Comey's opening statement and subsequent testimony were coordinated with Mueller."

Judicial Watch was able to obtain the DOJ/FBI emails after filing a FOIA lawsuit in January of this year because the DOJ did not respond to the group's FOIA request from August 2017.

In that FOIA request, Judicial Watch had asked for the following information:

"All records of communications between the FBI and Comey prior to and regarding Comey’s testimony before the Senate Select Committee on Intelligence on June 8, 2017.

"All records of communications between the FBI and Comey relating to an upcoming book to be authored by Comey and published.

"All records, including but not limited to forms completed by Comey, relating to the requirement for prepublication review by the FBI of any book to be authored by Comey with the intent to be published or otherwise publicly available."