A series of tweets by President Donald Trump about the investigation into contacts between his 2016 campaign and Russia have raised alarm among both Democratic and Republican lawmakers, with warnings Trump could be wading into "peril" with his comments.

"I would just say this with the president: There's an ongoing criminal investigation," Republican Senator Lindsey Graham said on the CBS program Face the Nation.

"You tweet and comment regarding ongoing criminal investigations at your own peril," he added.

On Sunday morning, Trump wrote on Twitter that he never asked former FBI Director James Comey to stop investigating Michael Flynn, the president's former national security adviser - a statement at odds with an account Comey himself has given.

That tweet followed one on Saturday in which Trump said he had fired Flynn because the former national security adviser had lied to the FBI.

Trump's lawyer, John Dowd, said in an interview with Reuters that he had drafted the tweet and said putting it together had been a "mistake."

"I'll take responsibility," Dowd said.

Trump has also renewed his attack on the credibility of the FBI after revelations an FBI agent was removed from the team investigating Russian election meddling because of anti-Trump text messages.

In a series of tweets, Trump questioned the direction of the federal law enforcement agency and wrote that the FBI's reputation is "in Tatters - worst in History!" and vowed to "bring it back to greatness".

The tweets came after a dramatic turn of events on Friday in which Flynn pleaded guilty to lying to the FBI and agreed to cooperate with prosecutors delving into contacts between Trump's inner circle and Russia before he took office.

Legal experts and some Democratic lawmakers said if Trump knew Flynn lied to the FBI and then pressured Comey not to investigate him, that could bolster a charge of obstruction of justice.

Special counsel Robert Mueller is investigating links between the Trump 2016 election team and Russia. (Photos:AP).

The Russia matter has dogged Trump's first year in office, and this weekend overshadowed his first big legislative win when the Senate approved a tax cuts bill.

Flynn was the first member of Trump's administration to plead guilty to a crime uncovered by special counsel Robert Mueller's wide-ranging investigation into Russian attempts to influence the 2016 US election and potential collusion by Trump aides.

Russia has denied meddling in the election and Trump has said there was no collusion.

Comey, who had been investigating the Russia allegations, was fired by Trump in May. He told the US Senate Intelligence Committee in June he believed his dismissal was related to the Russia probe, and said Trump asked him to end the investigation of Flynn.

"I never asked Comey to stop investigating Flynn. Just more Fake News covering another Comey lie!" Trump said on Twitter on Sunday.