The broadside was a riposte to a far more sober but equally emphatic rejection by the intelligence community during congressional testimony Tuesday of many of Trump's claims to foreign policy successes.
"The Intelligence people seem to be extremely passive and naive when it comes to the dangers of Iran. They are wrong!" Trump tweeted. "Perhaps Intelligence should go back to school!"Insisting that Iran's nuclear program remains dangerous, Trump said his intelligence advisors -- who believe Tehran is largely abiding by an international commitment to shelve nuclear weapons ambitions -- need to be more realistic.
It was hardly the first time Trump has openly criticized his own intelligence and law enforcement agencies.
However, the extent and vehemence of the criticism and the intensely public way Trump expressed his anger, showed how deep the split is between the White House and some of the country's most respected security officials.
The broadside, including tweets in which Trump touted the success of his policies in Syria and North Korea, followed testimony Tuesday by top intelligence chiefs that was widely seen as contradicting the president's rosy assessments.
In a hearing on global threats at the Senate Intelligence Committee, the top officials took issue with Trump's assertion that the Islamic State militant group has been defeated, and that North Korea can be convinced to forego its nuclear weapons.
The Senate hearing took place weeks after Trump cited a victory over Islamic State to justify his sudden announcement of an immediate pullout from Syria, a move that alarmed the US defense establishment and allies in the Middle East.
And it came just weeks before Trump plans a second summit with North Korean leader Kim Jong Un to negotiate a hoped-for denuclearization of the deeply isolated state.
Trump has put great store by his personal relationship with Kim and insisted again Wednesday that there is a "decent chance" of North Korea giving up its nuclear weapons.
But in the intelligence community's annual joint report, the view on North Korea was that its leaders still "view nuclear arms as critical to regime survival."
Trump also doubled down on his claim that the Islamic State group, or ISIS, which used to control large parts of Iraq and Syria, will "soon be destroyed," something "unthinkable two years ago."
In his testimony Tuesday, Director of National Intelligence Dan Coats stated that "ISIS still commands thousands of fighters in Iraq and Syria... and thousands of dispersed supporters around the world, despite significant leadership and territorial losses."
Closer to home, Trump has described illegal immigration by poor Central Americans as a national security crisis that he likens to an invasion and can only be stopped by building border walls.
The issue dominates his domestic agenda and has pushed him into a debilitating row with Congress, which so far has refused to provide wall funding.
Tellingly, the intelligence agencies' group assessment on Tuesday referred to migration and cross-border crime, but did not mention any need for a wall.