WASHINGTON — Former FBI director James Comey confirmed Wednesday that President Trump requested his loyalty and later urged him to drop the investigation into ex-national security adviser Michael Flynn, according to a preview of his highly anticipated testimony.

Comey, who was abruptly fired in May in the midst of a widening FBI investigation into whether Trump associates colluded with Russian officials who sought to influence the presidential election by hacking Democrats, outlined nine contacts with the president in a seven-page opening statement filed with the Senate Intelligence Committee.

These contacts included a Jan. 27 dinner in which Trump apparently said: “I need loyalty, I expect loyalty.’’

“I didn’t move, speak or change my facial expression any way during the awkward silence that followed,’’ Comey said of the exchange.

Later, in a Feb. 14 meeting at the White House, Comey said Trump strongly defended Flynn, saying that his former national security adviser “hadn’t done anything wrong’’ in his prior contact with Russian ambassador Sergey Kislyak. Flynn had been fired one day prior for lying to administration officials about his communications with Kislyak.

“I hope you can see your way clear to letting this go,’’ Comey said, quoting the president. “He is a good guy. I hope you can let this go.’’

Alarmed by the exchange, Comey said he prepared an "unclassified memo'' immediately after the conversation and later discussed it with FBI senior leadership.

“I had understood the president to be requesting that we drop any investigation of Flynn in connection with false statements about his conversations with the Russain ambassador in December,'' Comey said. "I did not understand the president to be talking about the broader investigation into Russia or possible links to his campaign. I could be wrong … Regardless, it was very concerning given the FBI’s role as an independent investigative agency.’’

Comey's written statement is remarkable for its detail, describing furnishings in the rooms where they met and their seating arrangements.

In one of his six telephone contacts with the president, Comey said Trump called him directly at FBI headquarters March 30 and described the ongoing Russia investigation as "a cloud'' that was impairing the president's ability to lead the country.

"He said he had nothing to do with Russia, had not been involved with hookers in Russia and had always assumed he was being recorded when in Russia,'' Comey wrote. "He asked what we could do to 'lift the cloud.' I responded that we were investigating the matter as quickly as we could, and that there would be great benefit, if we didn't find anything, to our having done the work well. He agreed, but then re-emphasized the problems this (investigation) was causing him.''

Toward the end of the extraordinary conversation, Comey said that Trump again stressed that the ''cloud'' of the Russia investigation was interfering with his ability to govern.

"He hoped that I could find a way to get out that he wasn't being investigated,'' Comey wrote. "I told him I would see what we could do, and that we would do our investigative work well and as quickly as we could."

Immediately after the March 30 call, Comey said he reported the conversation to then-acting Deputy Attorney General Dana Boente. Attorney General Jeff Sessions had earlier recused himself from considering all Russia-related matters because he had failed to disclose his own previous contacts with the Russian ambassador during his January confirmation hearing.

"I did not hear back from him before the president called me again two weeks later'' to ask what Comey had done to "get out'' the word that Trump was "not personally under investigation.''

Comey said he ultimately told Trump to pursue that information through Boente's office, "which was the traditional channel'' for contacts between the White House and the FBI.

Trump made Comey nervous enough that he started recording his meetings and calls with Trump immediately afterward in a series of memos, something he did not do with President Barack Obama, Comey said in his prepared testimony.

About their Jan. 27 dinner, Comey wrote, “My instincts told me that the one-on-one setting, and the pretense that this was our first discussion about my position, meant the dinner was, at least in part, an effort to have me ask for my job and create some sort of patronage relationship. That concerned me greatly, given the FBI’s traditionally independent status in the executive branch.”

Contributing: Ray Locker