On Wednesday, the leader of the Islamic State, Abu Bakr al-Baghdadi, issued his first audio statement in over ten months. Preceding it was the usual anticipatory self-pleasuring from certain corners of the jihadist internet, as supporters prepared themselves to receive fresh marching orders from their shadowy sovereign. The preparation was more feverish than usual, due to the Islamic State’s series of losses around Mosul and the long interval since Baghdadi’s last statement. In 30 orotund minutes, Baghdadi confirmed that, for him, nothing has changed. Fight the Shia, he said. Fight the Alawites of Syria’s Assad regime, and bring the war to Saudi Arabia, Turkey, and beyond. If you can’t come to Syria and Iraq, he said, remember that martyrdom in Libya—where the Islamic State maintains about a block or two of territory in the city of Sirte—is just as glorious.

We have heard all this murderous bluster before, and the message has grown no more palatable through repetition. But like most of Baghdadi’s statements, this one is laden with allusion and implication, and the subtexts and references to early Islamic history bring new meaning to the same superficial message. This speech is not just warmed-up leftovers. It is a promise that names of those who stand their ground and fight in Mosul will be inscribed in the history of Islam with those of the Prophet’s earliest companions, in a re-enactment of the Battle of the Trench, from 627.

For anyone with knowledge of the Koran or early Islamic history, the allusion is unsubtle. The speech’s title quotes the Koran: “This is What God and His Messenger Promised Us,” a reference to the 22nd verse of the Koran’s Surah al-Ahzab. The word “Ahzab” is the plural of hizb, meaning “party” or “clan” (as in Hizbullah, “the party of Allah”). In the Koranic context, the clans in question are a coalition of Bedouins led by Muhammad’s own tribe of Quraysh. The Quraysh had not taken kindly to Muhammad when he urged them to discard their pagan gods and worship God alone, and in 622, they drummed him out of town to live as a refugee in Medina. There he raised a formidable monotheistic army, and in 627, the Ahzab were the alliance that prepared to sack Medina and end his reign.

For months now, Islamic State supporters have likened the coming battle for Mosul to the battle between Muhammad and the Ahzab. Baghdadi’s speech is the most prominent document to make the analogy. (I have seen it previously in individuals’ posts on Telegram, the Islamic State’s current favorite messaging app.) Those eager to see parallels between the present and the past, and take from them confidence that the Islamic State will prevail just as Muhammad did, will find them in abundance.

The Ahzab outnumbered Muhammad’s army 10,000 to 3,000, and—at least as important—they had cavalry, and Muhammad had only infantry. He overcame these disadvantages with an ingenious engineering tactic on the northern outskirts of Medina. In the days before the attack, his army dug a trench large enough to stop cavalry, and he denuded the nearby fields of barley, so the Ahzab horses, in addition to being useless in combat, had nothing to eat. (The other sides of the city had natural defenses against cavalry and therefore needed no trenches.) The Ahzab could respond only by besieging Medina—but they lacked the resources and political cohesion for a long operation. After less than a month, they packed up and retreated to Mecca. Muhammad’s army followed them and conquered Mecca in 630.

Baghdadi refers twice to this battle: once in the beginning of his speech and its title, and a second time toward the end. The first reminds his followers that the righteous path is difficult, and that difficulty is a sign of divine favor: The fact that a coalition has amassed against the Islamic State, vastly outnumbering its fighters, only strengthens the comparison between the Battle of the Trench and the Battle of Mosul. These trials are all part of the process of purifying the ranks of the believers, and sorting the strong of faith from the weak. The second reference (to Koran 33:16) urges the soldiers to hold their ground, because those who turn their back on jihad will trade the pleasures of paradise for short-lived benefit in this world, since the enemy will kill those who retreat. Why not instead die magnificently, for a full helping of reward in the hereafter? Then he quotes a saying of the Prophet, reported by Salman the Persian (the Muslim tactician who had the brilliant idea of digging the trench): “A day and a night [fighting for Islam] is more meritorious than a month of fasting.” Fight, in other words, to the death.

Nowhere does he say “this is our Battle of the Trench”—that would be too gauche and hubristic even for Baghdadi—but he leaves no doubt that that episode in early Islamic history should be the model for the Islamic State’s fighters today. Outnumbered and outgunned, they should terraform their way to victory. This time they have dug tunnels rather than a trench, but the goal is the same: Delay the coalition victory long enough to make its fighters tired and to drain their resources. Eventually they will squabble—Kurds against Shia against Americans—and scurry away, and the Muslims will stand victorious.

After the Battle of the Trench, Muhammad’s enemies in Mecca had no choice but to acknowledge him as a formidable rival power. The dissenting factions within Medina fell into line behind him. Baghdadi, still viewing himself as the chief of an underdog sect, no doubt hopes for a similar victory along multiple dimensions. An ignominious failure by the coalition, the modern Ahzab, would compel the world to acknowledge the enduring nature of the Islamic State, and it would force rival jihadists, such as the former Nusra Front (now Jabhat Fateh al-Sham), to admit that Baghdadi had done the tactically impossible, and might deserve their obedience on that basis alone. There is no more impressive path to victory than the path blazed by the Prophet himself.

The Battle of the Trench is a high-stakes analogy. The Muslims won the original battle, and Baghdadi will look pathetic if, after dropping heavy hints at his status as a latter-day Trench warrior, he instead loses the battle and is sent fleeing back to Syria. The Meccans made little progress after weeks of fighting. The Iraqi-led coalition has slowly but steadily taken territory from the Islamic State, and within days or weeks the city center itself may be contested. These are foreboding trendlines for Baghdadi. But he is nothing if not an optimist.