WASHINGTON/NEW YORK (Reuters) - U.S. President Donald Trump said on Saturday that actions by former national security adviser Michael Flynn during the presidential transition were lawful, and that he had had to fire him because Flynn had lied to the FBI and the vice president.

The president’s comment suggested he may have known Flynn lied to the FBI before he urged the FBI director not to investigate his former adviser, legal experts said. But they noted that it was unclear from the tweeted comment exactly what the president knew when.

Flynn is 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 last year’s U.S. presidential election and possible collusion by Trump aides.

“I had to fire General Flynn because he lied to the Vice President and the FBI. He has pled guilty to those lies,” Trump said on Twitter while he was in New York for a fundraising trip. “It is a shame because his actions during the transition were lawful. There was nothing to hide!”

Flynn, who on Friday pleaded guilty to lying to the FBI about his contacts with Russia, is a former Defense Intelligence Agency director who was Trump’s national security adviser only for 24 days. He was forced to resign after he was found to have misled Vice President Mike Pence about his discussions with Russia’s then-ambassador to the United States Sergei Kislyak.

“What has been shown is no collusion, no collusion,” Trump told reporters as he departed the White House for the New York trip. “There’s been absolutely no collusion, so we’re very happy.”

Establishing when Trump was told Flynn lied to the FBI agents could be key to determining if the president acted improperly.

According to a person familiar with the matter, during a conversation between White House counsel Don McGahn and then-acting attorney general Sally Yates in January, Yates told McGahn that Flynn had told FBI agents the same thing he had told Pence.

This was the same conversation reported earlier this year in which Yates told McGahn that Flynn had misled the vice president about his conversations with the Russian ambassador and that he might be compromised, the person said.

However, Yates did not give McGahn the impression that the FBI was actively pursuing Flynn for lying, the source said. McGahn did not believe the FBI was investigating Flynn for lying because the bureau had not revoked his security clearance, the person said.

McGahn shared the information from Yates with the president, the person said.

A lawyer for McGahn did not immediately respond to a request for comment. Yates did not immediately respond to an email seeking comment.

Legal experts said if Trump knew Flynn lied to the FBI and then pressured then-FBI director James Comey not to investigate him, that would be problematic.

Slideshow ( 9 images )

If that were the case Trump’s tweet “absolutely bolsters an obstruction of justice charge,” said Jimmy Gurule, a former federal prosecutor and a law professor at Notre Dame University. “It is evidence of the crucial question of whether Trump acted with a corrupt intent.”

In May, the president fired Comey, who later accused Trump of trying to hinder his investigation into the Russia allegations. Comey also said he believed Trump had asked him to drop the FBI’s probe into Flynn.

Andrew Wright, a professor at Savannah Law School, said the tweet is open to interpretation and that Trump’s lawyer would downplay its significance.

Slideshow ( 9 images )

White House attorney Ty Cobb referred questions about the president’s tweet to Trump’s personal attorney, John Dowd, who described it as a “paraphrase” of a statement Cobb had made on Friday reacting to Flynn’s guilty plea.

According to a person familiar with the matter, Dowd composed the tweet.

The tweet is “bizarre and helpful to Mueller and hurtful to the president,” said Renato Mariotti, a former federal prosecutor in Chicago now at the law firm Thompson Coburn. “It’s one more piece of evidence that helps show the president’s intent when he fired Comey.”

As part of his plea on Friday, Flynn agreed to cooperate with the investigation.

The retired U.S. Army lieutenant general admitted in a Washington court that he lied to FBI investigators about his discussions last December with Kislyak.

In what appeared to be moves undermining the policies of outgoing President Barack Obama, the pair discussed U.S. sanctions on Russia, and Flynn asked Kislyak to help delay a United Nations vote seen as damaging to Israel, according to prosecutors.

Flynn was also told by a “very senior member” of Trump’s transition team to contact Russia and other foreign governments to try to influence them ahead of the U.N. vote, the prosecutors said.

Sources told Reuters the “very senior” transition official was Jared Kushner, Trump’s son-in-law and senior advisor. Kushner’s lawyer did not respond to multiple requests for comment.

Separately, speaking at a defense conference in California on Saturday, Trump’s current national security advisor H.R. McMaster said he saw no evidence that the indictment of Flynn, his immediate predecessor, was hurting U.S. national security.

“There’s tremendous confidence, I think there’s more confidence in the United States frankly. I think there’s a sense that we’re re-engaging in areas where we had largely disengaged,” he said.