Few historical figures have lived up to their epithets quite as fully (or bloodily) as Vlad the Impaler. Legend has it that the medieval Romanian ruler, who had a habit of putting wooden spikes through anyone who crossed him, inspired Bram Stoker’s Dracula. But sometimes history is even more horrifying than fiction—consider, for example, the time Vlad used a forest of corpses to shock and repel an invading Ottoman army.

In 1461, Vlad III was on his second of three reigns as the ruler of Wallachia, a small Balkan country in present-day Romania wedged between Hungary and the Ottoman Empire. In his five years on the throne, Vlad had already beheaded, boiled, burned, skinned, maimed, and impaled enough people to earn a reputation for cruelty. He had also earned the enmity of the Ottoman sultan Mehmed II by refusing to pay the haraç, an annual tribute the Ottomans demanded from their non-Muslim neighbors. In fact, when Mehmed II sent two envoys to Wallachia to collect his taxes that winter, Vlad ended up having them both killed and impaled. Then, for good measure, he crossed the Danube River into Ottoman territory and destroyed all the villages and defensive works he found there.

This didn’t sit well with Mehmed, who eight years earlier had sacked Constantinople, toppled the Byzantine Empire, and earned himself the epithet “the Conqueror.” The sultan raised an army of about 90,000 soldiers—nearly as large as the one he had used to besiege Constantinople—to march on Wallachia and take vengeance on Vlad. Meanwhile, Vlad conscripted a peasant militia of roughly 30,000 Wallachians armed with spears and bows.

As the Ottoman army advanced across Wallachia toward the capital of Târgoviște, Vlad torched crops, poisoned wells, and evacuated the villages in Mehmed’s path in order to deprive the Ottomans of any supplies. Meanwhile, Vlad’s soldiers hid in the woods and harassed the Ottomans with guerilla raids to slow their advance. But the ragged Wallachian resistance couldn’t stop the sultan’s army, and soon the Ottomans were camped just outside Târgoviște.

Backed up against his own gates, Vlad came up with a new plan. On the night of June 17, 1462, he led a cavalry raid into the Ottoman camp in an attempt to personally assassinate Mehmed. He meant to ride down on the sultan’s tent and kill him before his army had a chance to wake up, but luckily for Mehmed, Vlad got lost and hit the wrong tent. Inside was the Ottoman grand vizier and another top official, but not the sultan himself. Soon the Ottoman troops regrouped, repelled the raiding Wallachians, and chased them out of the camp. Vlad and the remnants of his army escaped into the night.

The next day, Mehmed and his troops continued their march. When the Ottomans finally reached Târgoviște they saw, to their surprise, that the city gates were swung open, no soldiers stood watch upon the walls, and the capital’s residents were nowhere to be seen. Mehmed’s army marched three miles into town without meeting any resistance.

But then they found something far more disturbing: a grotesque forest of wooden stakes piled high with skewered Ottoman corpses. Chalkokondyles, a contemporary Greek historian, claims there were 20,000 bodies in all, arrayed over an area of more than seven acres. The tallest stake reportedly propped up Hamza Pasha, the Ottoman official who had led the envoy sent to demand tribute from Vlad the year before. (It seems Vlad had been stockpiling corpses from previous raids to create this brutal display, and also impaling all of his Ottoman prisoners of war in preparation for the sultan’s arrival. But the exact source for all the bodies remains somewhat unclear.)

According to Chalkokondyles, upon seeing the grisly scene, “the sultan was seized with amazement and said that it was not possible to deprive of his country a man who had done such great deeds, who had such a diabolical understanding of how to govern his realm and its people. And he said that a man who had done such things was worth much.”

After taking in as much of the sight as he could stomach, Mehmed turned his army around and marched back to Turkey.

But Vlad wasn’t out of the woods yet. His army was all but destroyed, and he had devastated much of his own land with his scorched earth tactics. To make matters worse, on his way out of town, Mehmed had left Vlad’s younger brother, Radu, behind with a small force of Ottoman troops to challenge Vlad for the throne. Now, Radu roamed through the country stirring up support for his revolt among the Wallachian boyars, the country’s feudal lords.

It wasn’t a tough sell, according to Chalkokondyles. “There are no livestock or pack animals left,” Radu reportedly told them. “You have suffered all these horrible things on account of my brother, and you ingratiate yourselves with a most unholy man who has brought such harm upon Wallachia as we have not heard has been visited upon any other part of the earth.”

The boyars rebelled, and by November, Vlad had been deposed and imprisoned in Hungary. He would return to the throne one more time 14 years later, and rule for just two months before being killed in battle in 1476. The man who slayed him was Basarab Laiotă, a Wallachian rival backed by an Ottoman sultan—none other than Mehmed II.