U.S. President Donald Trump tweeted an attack on Special Counsel Robert Mueller's Russia investigation on Thursday and admitted for the first time that Russia "helped me to get elected" — while denying any involvement. Later in the day, Trump retracted the statement.

Trump tweeted: "Russia, Russia, Russia! That’s all you heard at the beginning of this Witch Hunt Hoax. ... And now Russia has disappeared because I had nothing to do with Russia helping me to get elected. It was a crime that didn’t exist. So now the Dems and their partner, the Fake News Media,....."

He continued in a second tweet: "....say he fought back against this phony crime that didn’t exist, this horrendous false accusation, and he shouldn’t fight back, he should just sit back and take it. Could this be Obstruction? No, Mueller didn’t find Obstruction either. Presidential Harassment!"

Trump, hours later, deleted the tweets and reposted them fixing typos.

Open gallery view Trump deletes tweet finally admitting Russia helped elect him Credit: Screen shot / Twitter

Read more: Fox News senior analyst: Mueller said he would indict Trump if he weren't president |Even Netanyahu knows it’s over: Analysis

Trump has long contended that his 2016 presidential victory, which he often refers to as one of the greatest of all time, was in no way aided by the Russians. Trump on multiple occasions has falsely claimed that his 306-point electoral college win was the biggest since Ronald Reagan, despite former President Obama winning with 332 points in 2012.

White House adviser Kellyanne Conway regularly uses a talking point that the allegation that Russia helped Trump win is an insult. “The idea that any of us, and me as a campaign manager, would cheat, steal, lie, cut corners, talk to Russians, was an insult from the beginning,” Conway said last month while talking to reporters.

Trump told reporters Thursday as he departed the White House, "Russia didn't help me at all." He said Russia would have preferred that Hillary Clinton be elected, not him.

Read more: 'Flurry of lies:' CNN banner blasts Trump's statements on Mueller probe

Trump claimed, "Nobody has been tougher" on Russia "than me."

Mueller said that charging Trump with a crime was "not an option" because of federal rules, but he used his first public remarks on the Russia investigation to emphasize that he did not exonerate the president.

"If we had had confidence that the president clearly did not commit a crime, we would have said so," Mueller declared on Wednesday.

Trump unleashes fury on Mueller

The special counsel's remarks stood as a pointed rebuttal to Trump's repeated claims that he was cleared and that the two-year inquiry was merely a "witch hunt." They also marked a counter to criticism, including by Attorney General William Barr, that Mueller should have reached a determination on whether the president illegally tried to obstruct the probe by taking actions such as firing his FBI director, James Comey.

Mueller made clear that his team never considered indicting Trump because the Justice Department prohibits the prosecution of a sitting president.

"Charging the president with a crime was therefore not an option we could consider," Mueller said during a televised statement.

He said he believed such an action would be unconstitutional.

Mueller did not use the word "impeachment," but said it was the job of Congress, not the criminal justice system, to hold the president accountable for any wrongdoing.

The Associated Press contributed to this report