All of the territory in Syria previously controlled by ISIS has been eliminated, the White House said Friday, and President Donald Trump showed reporters and a crowd of his supporters an upside-down pair of before-and-after maps to prove it.

'So here is ISIS on Election Day, here's ISIS right now.' he said on the tarmac in West Palm Beach, Florida as he pointed to the two different versions of the same territory. 'If you look — so there's ISIS. And that's what we have right now, as of last night. That's what we have right now.'

After posing for photos, he gave the map to a journalist, saying, 'You guys can have the map. Congratulations. You’ll spread it around?'

Trump then shook hands with a few dozen fans who had shown up to see him arrive from Washington, and signed a red 'Make America Great Again' hat.

President Trump held up his ISIS before-and-after maps upside-down on Friday as he showed them off to reporters

Trump handed his map to a reporter and asked him to pass it around, not knowing that he had just posed for pictures with the paper inverted

TOPSHOT - Heavy smoke rises above ISIS's last remaining position in the village of Baghouz during battles with the Syrian Democratic Forces on March 18

Aboard Air Force One before Trump deplaned, White House Press Secretary Sarah Sanders gave journalists a peek at the maps, holding them correctly.

The president showed off a similar map on Wednesday at the White House as he left for a brief trip to Ohio, and noted the tiny speck of red where ISIS fighters remained holed up.

The speck was gone on Friday but the whole sheet of paper was inverted.

Acting Defense Secretary Patrick Shanahan briefed Trump about developments on the ground, according to White House Press Secretary Sarah Sanders.

The president has been hinting at the victory for days.

Trump was quick to warn minutes later that the once-strong terror army is still a danger online.

Despite a total geographic victory over ISIS, he tweeted Friday that the group still 'uses the internet better than almost anyone,' and warned people susceptible to their propaganda campaigns that 'they will always try to show a glimmer of vicious hope, but they are losers and barely breathing. Think about that before you destroy your lives and the lives of your family!'

That's right: White House Press Secretary Sarah Sanders showed reporters the map aboard Air Force One and got it rightside-up

The president got it correct on Wednesday when he showed off his Defense Department maps at the White House

Syrian Democratic Forces (SDF) have liberated all of Baghouz from ISIS

Mustafa Bali, a spokesman for the Syrian Democratic Forces, tweeted 'Baghouz is free and the military victory against Daesh has been achieved,' referring to the group by its Arabic acronym.

Bali says the so-called caliphate, which once sprawled across much of Syria and neighboring Iraq, is gone, and pledged to continue the fight against remnants of the extremist group until they are completely eradicated.

Earlier it was was reported that ISIS fanatics were hiding in caves in their final holdout in Syria.

The Syrian Democratic Forces (SDF) battled militants holed up in Baghouz overnight, supported by coalition airstrikes.

The Kurdish-led SDF have been predicting imminent victory for days but while thousands of the terrorists have fled a few are still hiding in the Syrian village.

The jihadists were holed up in what appeared to be caves in a rocky shelf overlooking Baghouz, their final sliver of land along the Euphrates river.

A vehicle carrying fighters of the US-backed Kurdish-led Syrian Democratic Forces (SDF) drives through the village of Sousa

They were also hiding in trenches as war planes carried out two raids against ISIS movements on Thursday night.

'Our forces are trying to force them to surrender, but so far the clashes are continuing,' the SDF's Mustafa Bali said.

The SDF has been battling for weeks to defeat Islamic State at the Baghouz enclave in southeastern Syria at the Iraqi border.

Backed by U.S. air power, they swept on Tuesday into a camp where hundreds of fighters had been making their last stand, prompting early 'victory' celebrations.

They said they would declare the group defeated once a search for hidden mines and jihadist holdouts was complete.

The terror group's final defeat at Baghouz will end its territorial rule that once spanned a third of Iraq and Syria.

A cat walking past a destroyed building in the village of Sousa, near the village of Baghouz in the eastern Syrian province of Deir Ezzo

After sweeping across swathes of Syria and Iraq in 2014, the ISIS jihadists' cross-border caliphate has been whittled down by multiple offensives to the tiny embattled enclave in Baghouz, Syria (pictured)

But the U.S. military has warned that Islamic State may still count tens of thousands of fighters, dispersed throughout Iraq and Syria, with enough leaders and resources to present a menacing insurgency.

A propaganda video carrying the mark of an Islamic State news outlet was distributed among online followers of the group on Thursday.

It showed footage from inside Baghouz and a fighter calling for Muslims in Western countries to stage attacks.

The United States believes Iraq is the location of its leader Abu Bakr al-Baghdadi, who stood at the pulpit of the great medieval mosque in Mosul in 2014 to declare himself caliph, sovereign over all Muslims.

U.S. Secretary of State Mike Pompeo, on a visit to Jerusalem, told reporters victory was 'close'.

Fighters from the Syrian Democratic Forces (SDF) celebrate as they come back from the frontline in the battle against ISIS on Tuesday

Fighters from the SDF stand together in the village of Baghouz today as the final push to sweep ISIS from the area continues

He was proud of 'the work that the United States did, the Department of Defense did, that the folks fighting down in the Euphrates river valley did', he said.

'The threat from radical Islamic terrorism remains. We need to finish out the last few square metres there, in Syria. Still work to do.'

Thousands of people including women, children and fleeing jihadists have poured out of Baghouz into the al-Hol camp in north-eastern Syria.

The camp is now holding more than 72,000 people, including more than 40,000 children, rescue workers said.

The total number of deaths on the way to it or shortly after arriving now stood at 138, the overwhelming number of them babies and infants.