In the last days of Ivan Assen's rule, the threat of a Tartar invasion loomed over Bulgaria. His underage sons Koloman and Mihail II Assen, from his first and second marriage respectively, ascended the throne one after the other, and failed to repulse the Tartar onslaught from the north. With internal peace shattered by boyars' unrest, the hard-gained prosperity of Ivan Assen II was dwindling quickly. The Nicean Empire occupied lands in Macedonia and the Rhodopes. The Comnenus family took away Epirus and Albania, while the Hungarian king seized Belgrade and Branichevo.
In 1257 internecine strifes brought to the throne Konstantin Tih, a boyar from Skopje. He was a mediocre ruler, unable to save the state. The Byzantine Empire, restored in 1261, seized a number of towns in Thrace and along the Black Sea coast. Autocratic boyars governed independently in the different regions of disunited Bulgaria. The Tartars continued their pillaging raids. To replenish the depleted treasury, Tsar Konstantin Tih imposed heavier taxes on the population.
It was during this time that the peasant tsar Ivailo ascended the throne. Byzantine chroniclers did not write much about his earlier years. They do mention that he used to be a swineherd in his native Dobroudja. However, the illiterate swineherd was a born orator who cared for his country. He managed to convince the peasants he was God's elect who was to liberate them from the tax burden, the rulers' arbitrariness and the foreign invaders.
It was perhaps due to the exhaustion of the people's patience that a revolt broke out spontaneously in 1277, when Ivailo and his men repelled the raid of a large Tartar horde. A valiant warrior and a talented commander, the peasant leader inflicted a series of defeats on the Tartars, temporarily discouraging them from further attacks.
Ivailo's fame mounted quickly. Thousands of peasants joined his army. He slowly gained sufficient self-confidence to challenge the tsar and the boyars. Before he set out for Turnovo the peasants proclaimed him tsar. Georgius Pachimeres wrote: "Whenever he seized a town, he was celebrated as tsar and leader. One after the other the regions placed themselves under his command, believing they would thrive under his rule."
The peasants believed that the young and energetic Ivailo could easily defeat the old and inactive Konstantin Tih whose rule had been a disaster for the state. The dream of the good tsar, so common during the Middle Ages, was revived once again. The peasants regarded Ivailo as a patriot, ready to stand up for the independence of the state and the people.
In the battle between the rebel army and the tsar's troops, Ivailo was victorious and Tsar Konstantin Tih died on the battlefield. Mercenary boyars joined Ivailo in order to preserve their power and privileges. The rebels besieged the capital.
In light of the internecine fighting in Bulgaria, the basileus attacked Eastern Thrace, threatening the rebels' rear. In the face of uncertainty, fighting on two fronts, Ivailo was compelled to seek reconciliation.
Ivailo was crowned and ruled as tsar from 1278 to 1280. He was forced to wage wars all the time, either against the Byzantines to the south, or against the Tartars to the north. After fierce fights in the Balkan passes his commanders Momchil, Kuman, Stan, Damyan and Kuncho managed to break off the offensive of the Byzantines. Then his army drove the Tartars beyond the Danube.
However, the next year the Byzantine army reached Turnovo. The emperor's protege Ivan Assen III seized the throne. Fighting his way out of the besieged stronghold of Drustur (today's Silistra) on the Danube, Ivailo headed for Turnovo in 1280. Again thousands of peasants joined his army. But the situation in Turnovo had changed. The boyar Georgi Terter dethroned Ivan Assen III and unified the nobles. Byzantine chronicler Pachimeres wrote of numerous successful fights of Ivailo's army against the Byzantines, but they failed to ward off the Byzantine threat. Frustrated and discouraged, the peasants deserted Ivailo. Lacking in experience as a statesman, he sought a way out. He turned to his one-time enemies, the Tartars, and was murdered in their camp on the order of Khan Nogay.
For several decades Ivailo's fame would not subside in the neighboring countries and rebel leaders used his name to attract supporters. However, none of these leaders could match him, and none of them ever made it to the throne.