With its two biggest victories in nearly a year in Iraq and Syria, Islamic State has energized its fighters, littered the streets of two cities with the bodies of its enemies and forced Washington to re-examine its strategy.
The near simultaneous capture this month of Ramadi west of Baghdad and Palmyra northeast of Damascus has reinforced the sway of the self-proclaimed caliphate of all Muslims closer to the ramparts of Islam's two great historic capitals.
But although the fighters sound triumphant on YouTube, vowing to press on to Baghdad and Damascus, there appears to be little room for them to expand their territory much further -- at least for now.
In both Iraq and Syria they have lost ground in recent months as well as gained it. The weakest targets are already in their grasp, and they will have to devote as much effort to holding and administering the areas that they already control as to attempting to extend their onslaught.
In Iraq, Islamic State fighters already hold most of the land where their fellow Sunni Muslim Arabs predominate. The Shi'ite-led government has responded to the loss of Ramadi in the Euphrates River valley by dispatching Iran-backed Shi'ite militia, fresh from beating Islamic State fighters in the valley of Iraq's other great river, the Tigris.
In Syria, rival Sunni Arab insurgent groups, once seen as feeble in comparison with Islamic State, have drawn support from Arab countries and grown stronger, expanding their own territory at the expense of the government of President Bashar al-Assad.
In both countries, Islamic State has also suffered defeats at the hands of Kurds.
But even if there are limits to how far Islamic State -- also known as ISIS -- can expand its territory for now, the victories this month give it crucial momentum, important for maintaining the support of people in the places it rules over.
"The priority for ISIS now is to capitalize on the momentum that is gained from taking control of Ramadi and Palmyra because this war has been about momentum shifts," said Ahmed Ali, senior fellow at Washington D.C.'s Education for Peace in Iraq Center.
"Up until (when) ISIS was able to take control of Ramadi, the momentum was against ISIS. Now this is a prime opportunity for ISIS to keep pushing, because it's trying to regain its reputation as this invincible force."
In Iraq, after the army collapsed last year and Islamic State seized much of the north of the country in a lightning advance, the government and its allied Shi'ite militia rallied to halt the offensive before the gates of Baghdad.
Islamic State fighters fell short of their objective of seizing Samarra north of the capital, site of one of the most revered Shi'ite shrines, which they had pledged to destroy.
The government and its militia allies are now firmly in control of the majority-Shi'ite capital itself, and have so far prevented Islamic State from securing strong footholds in Sunni farmland on its southern and western outskirts, territory known as the "triangle of death" during the 2003-2011 US occupation.
In March, government forces and the militia advanced north of Baghdad into the Tigris valley, recapturing former dictator Saddam Hussein's home town Tikrit.
The Shi'ite militia, with Iranian funds, weapons and advisers, have proven a particularly capable force on the battlefield, although Washington is worried that their presence will exacerbate sectarian tensions.
Until now, the government had kept the Shi'ite militia out of the overwhelmingly Sunni Euphrates valley west of the capital. But the fall of Ramadi has forced Baghdad to dispatch them, meaning Islamic State will now face a more formidable foe.
Washington's fear is that the presence of the Shi'ite militiamen will drive local tribes to embrace Islamic State. The Pentagon described as "unhelpful" a decision by the Shi'ite militia to give their advance a sectarian slogan as a code name.
But just as in 2006 and 2007, when the brutality of Islamic State's al-Qaida predecessors drove many Sunni tribesmen to make peace with hated US Marines, the fighters' extreme violence means some locals may tolerate even the feared Shi'ites.
Islamic State fighters contacted by Reuters in Iraq say their main task for now is combating the "awakenings" -- Sunni tribesmen who have resisted their rule.
They have killed hundreds of sheikhs and local tribal leaders in the Euphrates valley. But that sort of violence brings blood feuds that in the past made their rule short-lived.
Michael Knights, an Iraq expert at the Washington Institute, said that with the capture of Ramadi, the fighters had reached the natural boundaries of a state to rule Sunni territory.
Although they could still launch attacks on Baghdad itself, those would more likely be isolated attacks rather than a campaign to seize the city.
"In Iraq, ISIL is still losing ground, not gaining it, regardless of tactical gambits like Ramadi," he said, using another acronym for the group. "ISIL is only capable of tinkering at the peripheries of the areas it already holds."
Syria, where Assad's government has been on the back foot in recent months, offers greater potential opportunities for Islamic State to advance further. Unlike in Iraq, Sunni Muslims are the majority across the country, so a group seeking to rule over Sunnis faces fewer natural limits to its expansion.
While Washington supports the Iraqi government and has used its air power to fight Islamic State in Iraq in conjunction with Baghdad, in Syria it remains opposed to Assad and has no strong allies on the ground.
"On the Syria side, it's a completely different dynamic because ISIS there does not have a formidable force in front of it," said Ali. "It's able to attack Syrian government forces and we have seen so far that the Syrian government forces have been retreating in front of ISIS attacks. So Syria might actually be more of an objective ... than Iraq."
Nevertheless, unlike in Iraq, Islamic State in Syria is only one of a number of Sunni Muslim insurgent groups, which run the gamut from hardcore jihadists like the al-Qaida-linked Nusra Front to comparatively secular nationalists.
When Islamic State was surging into Iraq last year and bringing advanced weaponry seized there back into Syria, it seemed like many of those other Sunni groups would fade into irrelevance.
But in recent months, Sunni groups that have resisted joining Islamic State have been receiving more weapons and funds from US-allied Arab states and possibly Turkey.
They have become more potent, inflicting defeats on Assad's troops and allies in the heavily populated southwest and northwest, and have remained more united than in the past.
Islamic State has also made gains, and tries to recruit other jihadists to join it. But many Syrians resent its foreign fighters and its Iraqi caliph, Abu Bakr al-Baghdadi. Commanders of other groups know that the only way to keep the Arab guns and money flowing is to resist any alliance.
But the victory in Palmyra, known as Tadmur in Arabic, helps Islamic State make the case that it is still the most effective Sunni fighting force in Syria, which in the battle for loyalties is more important than the strategic value of any one target.
"We are working on bringing in more fighters. That is why seizing Tadmur was very important, it is significant," said an Islamic State fighter reached by telephone, who declined to be named as he was not authorized to talk to the media.
"New fighters are now joining. Syrian fighters. They have discovered that the State is true and fulfills its promises and brings back your dignity."