But Trump, through his outside counsel, said he felt "completely and totally vindicated" by the account.
"The president is pleased that Mr. Comey has finally publicly confirmed his private reports that the president was not under investigation in any Russian probe," Marc Kasowitz, Trump's attorney, said in a statement.
Trump fired Flynn in February in a controversy over contacts between the retired general and the Russian ambassador to the United States. The FBI has been investigating Flynn as it looks into allegations of links between Russia and the Trump campaign.
In his statement, posted on the Senate Intelligence Committee's website, Comey said Trump also called him on March 30 to say he had nothing to do with Russia and asked what "we could do to lift the cloud" of the FBI's Russia investigation.
During that phone call, Comey said he told Trump the FBI was not investigating the president personally. "He repeatedly told me: 'We need to get that fact out,'" Comey said.
Comey said he had told Trump on three occasions he was not being investigated, confirming an earlier account from the president.
Several congressional committees, as well as the Federal Bureau of Investigation and a special counsel, are looking into reports that Russia tried to tilt last November's election in Trump's favor, using means such as hacking into the emails of senior Democrats. Trump and the Kremlin have separately denied any collusion.
Some legal experts said Comey's written statement could be used to show that Trump engaged in obstruction of justice.
"It shows the president was doing everything he could to shut down the Flynn investigation," said Andrew Wright, a professor of criminal law at Savannah Law School.
While a sitting president is unlikely to face criminal prosecution, obstruction of justice is an offense that could lead to impeachment hearings.
In impeachment proceedings, Congress must determine that a president committed a "high crime or misdemeanor."
Comey said Trump told him at a one-on-one dinner on January 27, a week after the president took office, that: "I need loyalty. I expect loyalty."
During the dinner, the president asked him if he wanted to stay on as FBI director, Comey said. The former FBI head said he became concerned that Trump was trying to create "some sort of patronage relationship."
After a Feb. 14 meeting on counterterrorism in the Oval Office, Trump dismissed all the participants except Comey, according to the testimony.
The president then initiated a conversation about Flynn.
Comey quoted Trump as telling him: "I hope you can see your way clear to letting this go, to letting Flynn go. He is a good guy. I hope you can let this go."
(Additional reporting by Tim Ahmann and Jeff Mason in Washington and; Jan Wolfe in New York; Writing by Alistair Bell and Roberta Rampton; Editing by Yara Bayoumy and Peter Cooney)