WASHINGTON — President Donald Trump appeared to cast doubt on the assessment of 17 U.S. intelligence agencies that blame Russia for election meddling, questioning Thursday why the Obama administration didn’t try to stop it.

“By the way, if Russia was working so hard on the 2016 Election, it all took place during the Obama Admin.,” the president tweeted. “Why didn’t they stop them?”

All 17 intelligence agencies have agreed Russia was behind the hack of Democratic email systems and tried to influence the 2016 election to benefit Trump. The findings are at the heart of an investigation into contacts that members of Trump’s campaign team may have had with Russian officials during the campaign and the transition.

By the way, if Russia was working so hard on the 2016 Election, it all took place during the Obama Admin. Why didn't they stop them? — Donald J. Trump (@realDonaldTrump) June 22, 2017

Trump, frequently lashes out at the Russia investigation as a “witch hunt” spearheaded by Democrats.

He tweeted Thursday that the Democratic National Committee turned down an offer from the Department of Homeland Security “to protect against hacks (long prior to election). It’s all a big Dem HOAX!”

“…Why did the DNC REFUSE to turn over its Server to the FBI, and still hasn’t? It’s all a big Dem scam and excuse for losing the election!” he wrote.

…Why did Democratic National Committee turn down the DHS offer to protect against hacks (long prior to election). It's all a big Dem HOAX! — Donald J. Trump (@realDonaldTrump) June 22, 2017

…Why did the DNC REFUSE to turn over its Server to the FBI, and still hasn't? It's all a big Dem scam and excuse for losing the election! — Donald J. Trump (@realDonaldTrump) June 22, 2017

Last month, Trump fired FBI Director James Comey, who was leading the agency’s Russia probe. The president has come under harsh criticism by some who claim he threatened to undermine the investigation by firing Comey.

Special counsel Robert Mueller was later named to lead the investigation, and The Washington Post reported that Mueller is considering investigating Trump for obstruction of justice because he fired Comey.

The investigation has shadowed Trump from the outset, though he’s denied any ties to Russia or knowledge of any campaign coordination with Moscow.

Trump also claimed Thursday that former Homeland Security chief Jeh Johnson “is latest top intelligence official to state there was no grand scheme between Trump & Russia.”

But Johnson didn’t say that in testimony Wednesday before the House intelligence committee. What he said was that he wasn’t aware of efforts by Trump or his campaign to collude with Russia beyond what the intelligence community already knows. Johnson also said Russian hacking didn’t change election totals, but he can’t be sure other meddling didn’t influence public opinion.

“It is not for me to know to what extent the Russian hacks influenced public opinion and thereby influence the outcome of the election,” he said.

Trump has picked fights with intelligence agencies in the past, blaming them for leaks about his associates’ Russia ties. During the transition before his inauguration, he ripped into the intelligence community for being behind the leaks and even compared them to Nazi propaganda. “Intelligence agencies should never have allowed this fake news to “leak” into the public. One last shot at me. Are we living in Nazi Germany?” he tweeted in January.

READ MORE: In Iowa, the president channels his inner candidate Trump