President Donald Trump has called US intelligence agencies "naive" on Iran and also dismissed their assessment of the threat posed by North Korea.
"Be careful of Iran. Perhaps Intelligence should go back to school!" Mr Trump tweeted.
The testy response came after a US intelligence report said Iran was not making nuclear weapons.
It also said that North Korea remained "unlikely to give up" its weapons stockpiles and production abilities.
National intelligence director Dan Coats and other intelligence chiefs presented the Worldwide Threat Assessment report to the Senate on Tuesday.
Last year, the US pulled out of the 2015 Iran nuclear deal, triggering widespread criticism from Washington's allies.
Trump also launched a diplomatic push to improve relations with North Korea, meeting the country's leader Kim Jong-un in Singapore last June to discuss denuclearisation of the Korean peninsula.
At the time, Trump said this meeting had ended the North Korean nuclear threat - a claim questioned by a number of US politicians and experts.
The US intelligence report also warned that cyber threats from China and Russia were a growing concern, and both countries may be seeking to influence the 2020 US presidential elections.
In a series of tweets, Trump said US intelligence officials "seem to be extremely passive and naive when it comes to the dangers of Iran. They are wrong!"
Iran, he continued, was "making trouble all over the Middle East, and beyond" in 2016, but had been "much different" since the US pullout from the "terrible" Iran nuclear deal.
However, Trump warned that Tehran remained "a source of potential danger and conflict", referring to reported recent Iranian rocket tests.
At the Senate hearing, CIA director Gina Haspel said Iran was "technically... in compliance" with the nuclear deal, despite the US withdrawal and the imposition of stricter sanctions against Tehran.
However, the intelligence report warned that Iran's "regional ambitions and improved military capabilities" would probably threaten US interests in the future.