Islamic State group fighters launched suicide attacks Wednesday at US-backed Syrian forces in a desperate bid to defend their last scrap of territory after 3,000 of their fellow jihadists surrendered.
Despite the attempted counterpunch the Kurdish-led Syrian Democratic Forces (SDF) said in an evening statement that its fighters had advanced as they conducted "a large-scale attack on terrorist positions".
Four SDF members were killed in clashes on Wednesday, it said.
AFP correspondents heard air strikes and artillery fire near the frontline after night fall Wednesday, on a fourth night of bombardment.
IS once ruled over millions in a swathe of Syria and Iraq, but it has since lost all that territory except for a riverside slither in the village of Baghouz near the Iraqi border.
Thousands of men and women have poured out of the pocket in recent weeks, hampering an advance by the SDF, which has paused its offensive multiple times to allow evacuations.
Supported by air strikes by the US-led coalition, the SDF resumed shelling on Sunday.
They unleashed a deluge of fire on jihadist outposts for three nights in a row, engulfing their makeshift encampment in a ravaging blaze.
"IS's final moments have started," SDF official Jiaker Amed told AFP Wednesday.
Clashes flared as the SDF worked to thwart any IS fightback.
Jihadists "launched two counterattacks today -- one in the morning and another in the afternoon", an SDF official told AFP.
"The second one was much stronger" and was launched under the cover of smoke caused by bombing, he said.
The official said jihadists were using suicide bombers but his force intercepted them before they reached their target.
The jihadists "made no progress and they were stopped," he said.
- 'Final hour' -
Inside Baghouz, the crackle and thud of gunfire and shelling rang out from the encampment as plumes of thick black smoke rose over the bombed-out IS bastion.
Amid the rubble, three SDF fighters lobbed a salvo of mortar shells towards the IS pocket, hours after the first attempted counterattack at daybreak under the cover of a dust storm.
On a rooftop near the front line, an AFP correspondent saw a warplane fire two missiles at IS positions.
Delil, an SDF fighter, said: "Today, the sandstorm is to their benefit but all coming days are ours."
Outside the village, dozens of evacuees sat in clusters on a field dotted with yellow flowers, a day after thousands of the last survivors of the "caliphate" handed themselves over to US-backed forces.
After a night of heavy bombardment on Tuesday, SDF spokesman Mustefa Bali said about 3,000 jihadists had handed themselves over to the SDF in the past 24 hours.
"The battle is ongoing and the final hour is now closer than ever," he said on Twitter.
But an SDF official said on Wednesday that "it appears as though many fighters remain inside" the last pocket.
Near the front line on Tuesday night, AFP correspondents saw bright, long streaks of light in the night sky as US-backed forces bombed jihadist outposts.
Explosions shook the IS pocket as large fires tore through a cluster of tents and buildings.
- 'No freedom of movement' -
Coalition spokesman Sean Ryan on Wednesday said IS has no room to manoeuvre.
"There is no freedom of movement at night for the enemy," he told AFP.
"Combined with the SDF ground movement against the final enclave, progress is being made and their capabilities are being severely destroyed."
Since December, about 60,000 people have left the last IS redoubt, according to the Britain-based Syrian Observatory for Human Rights, around a tenth of them suspected jihadists.
The exodus has sparked a humanitarian crisis in Kurdish-run camps for the displaced further north, which are struggling to accomodate the mass influx of women and children.
The UN's food agency on Tuesday appealed for urgent funding for the Al-Hol camp, which is receiving the bulk of evacuees.
At the height of its brutal rule, IS controlled a stretch of land in Syria and Iraq the size of the United Kingdom.
The total capture of the Baghouz camp by the SDF would mark the end of the cross-border "caliphate" it proclaimed more than four years ago.
But beyond Baghouz, IS retains a presence in eastern Syria's vast Badia desert and sleeper cells in the northeast.
The jihadists have continued to claim deadly attacks in SDF-held territory in recent months, and the US military has warned of the need to maintain a "vigilant offensive".
Baghouz is the latest major battlefront in Syria's complex civil war, which has killed more than 360,000 people since 2011.