The Byzantine–Hungarian War (1071–1072) was the first of the series of wars between the Byzantine Empire and the Kingdom of Hungary. When Pechenegs crossed the Sava and stormed into Hungary, Solomon, King of Hungary and Duke Géza suspected that the soldiers of the Byzantine garrison at Belgrade incited the marauders against the kingdom. The Hungarians laid siege to Belgrade. In the next year, their army reached as far as Niš, taking advantage of the difficult political situation within the Byzantine Empire. Division of the war-booty caused a new conflict between Solomon and his cousins, Géza and Ladislaus, which made further war against the empire impossible.

Sources The first conflict between the Kingdom of Hungary and the Byzantine Empire is narrated almost exclusively by the 14th-century Illuminated Chronicle, which contains contemporary or near-contemporary historical records from the era. This work narrates the events from a Hungarian perspective, avoiding contextualization. The contemporary Byzantine chroniclers (for instance, Michael Psellos, Michael Attaleiates and John Skylitzes) do not refer to the border conflict. The Russian Primary Chronicle (PVL), also a compilation of various texts from the Kievan Rus', contains data that may place the circumstances of the conflict in a broader context.

Background At the course of the Byzantine conquest of Bulgaria, the Byzantines conquered the area reoccupying the border fortresses of the former Roman limes in the early 11th century, establishing themes Bulgaria then Sirmium which bordered with the emerging Kingdom of Hungary along the lower course of the river Danube. Despite that, the first Hungarian king Stephen I was a close ally of the Byzantine Emperor, Basil II. He even joined the Byzantines in the war ending with their conquest of Bulgaria in 1018. The Kingdom of Hungary was not threatened by hostile Byzantine intentions for a long time, and in fact, in the middle third of the 11th century, during the pagan revolts and the invasions of the Holy Roman Empire, the Byzantine Empire was considered more of a support than an opponent, even if small-scale skirmishes did arise from time to time on the joint border along the Danube extending from the river Morava to the Carpathian Mountains. Hungary, likewise, did not intervene in the uprising of Petar Delyan in 1040, which aimed to restore the Bulgarian Empire.

Due to the Pecheneg revolts, the continuous Norman conquest of southern Italy and the beginning of the Byzantine–Seljuk wars, the Byzantine Empire experienced difficult decades, which, among other people, increased the appetite of the Hungarians too. It was then that the kingdom recovered from the two decades of turmoil that characterized the post-Stephen period. It is possible that the Pechenegs and the Hungarians, under the reign of Andrew I, launched a joint plundering raid against the realm around 1059.

The Hungarian monarch Solomon ascended the Hungarian throne with the assistance of the Holy Roman Empire in 1063. Solomon and his cousins – Géza, Ladislaus and Lampert – eventually reached an agreement: Géza and his brothers acknowledged Solomon as lawful king, and Solomon granted them their father's one-time ducatus. The king and his cousins closely cooperated in the period between 1064 and 1071, when various jointly organized military campaigns took place. Solomon pursued an active foreign policy towards the Balkans. It is possible that he, to some extent, supported the rebellion of the future emperor Romanos IV Diogenes, who served as commander of the cities on the Danubian frontier (i.e. Belgrade, Sirmium and Braničevo) prior to 1067.

The war Pechenegs' raid

A significant number of Pecheneg troops, who were settled in the border along the Danube in order to protect the borderland, crossed the river Sava at the Byzantine fort of Belgrade and pillaged the region Syrmia, located in southern Hungary, in the spring of 1071. They plundered the fields of Buziás in Syrmia, taking many prisoners and spoils of war. There, Vid Gutkeled, one of the most influential advisors of King Solomon, possessed extensive landholdings. Some historians identified the aforementioned landholding with Buziás (also called Fulbertfalva) in Valkó County or with Bežanija, present-day an urban neighborhood of Belgrade in Serbia, or a now uninhabited settlement located in present-day Ugrinovci in Zemun (also in Belgrade). Since a protracted war was not a common response to the everyday border conflicts typical of the era, it is possible that the Pechenegs penetrated deeper into the territory of the Kingdom of Hungary than before.

Hungarian historian János B. Szabó argued that there is no trace from this period of Pecheneg settlements directly near the Hungarian border, thus the raiders came either from the province of Paristrion east of Vidin, on the southern bank of the Danube, where at that time there was a very mixed population of Bulgarians, Vlachs, Pechenegs, and Ouzes, or from the area between Naissos (Niš) and Serdica (in Sofia) in the theme of Bulgaria, where groups of Pechenegs were settled after their failed revolt two decades earlier. According to Slovak historian Marek Meško, it is conceivable that the Pechenegs living north of the Danube, who had already invaded Hungary in 1068, were also responsible for the 1071 attack. Based on the data of the Russian Primary Chronicle, which narrates that Cumans crossed Dnieper and laid siege to the towns Rastovets and Neyatin in 1071, Hungarian historian Attila Kovács considered that Pechenegs (and Ouzes) fleeing the western expansion of the Cumans crossed Lower Danube and settled along the Byzantine border. In order to obtain the booty that ensured the existence of their political confederation, they pillaged southern Hungary, which their relatives, the Pechenegs who guarded the border, did not prevent.

The Hungarian king and his cousins suspected that the soldiers of the Byzantine garrison at Belgrade incited the marauders against Hungary. The Pechenegs were hired as mercenaries by the Byzantine Empire since 1048. Therefore, this attack provided the reason for Solomon and the dukes to launch a campaign against the Byzantine Empire. It is also possible that the military difficulties of the empire that occurred during the reign of Romanos IV Diogenes, mostly the Siege of Bari, which resulted the dissolution of the Catepanate of Italy, and the Battle of Manzikert, which resulted in the mobilization of significant forces from the north to the southern and eastern borders of the Byzantine Empire, provided an opportunity for Solomon to adopt an expansionist policy towards the south. The raids of Pechenegs into Hungary provided the pretext and legal basis for this. Kovács emphasized that it was not in the least interest of the Byzantines to anger the Hungarians and thus enable an attack on the empire at the worst possible time. In this context, the Hungarian invasion was a "backstabbing", which made the emperor's situation more difficult and can ultimately be considered one of the reasons for his downfall. The Hungarian royal court was obviously aware that the bulk of the Byzantine army had been in Asia Minor since early 1071 due to the imperial expedition against Alp Arslan. It is also conceivable that the Hungarians wanted to create a buffer zone to prevent or mitigate further Pecheneg incursions into their kingdom.

Hungarian counter-attack

Shortly after the Pechenegs' raid, Solomon declared a war against the Byzantine Empire. The Hungarian army – based on the county military organization and the system of castle warriors – gathered at the Hungarian border near the fortified city of Zalánkemén (present-day Stari Slankamen, Serbia). Solomon and his cousin Géza jointly launched their campaign against the empire; they were considered experienced and well-acquainted military leaders through the campaigns of previous years (their joint campaign against the Carantanians or Venetians in Dalmatia in 1066, the retaliatory campaign into Bohemia in 1067 and the fight against the invading Cumans in 1068). Based on the narration of the Illuminated Chronicle, the entire Hungarian military organization was mobilized, including the forces of the duchy under the command of the king's cousins, Géza and Ladislaus.

The Hungarians' war goal is unclear: Bulgarian historian Vasil Zlatarski considered that Solomon intended to submit whole Syrmia, occupying its parts south of the Danube. Hungarian historian Henrik Marczali claimed that the Hungarians aimed to conquer the Balkan Peninsula. In contrast, Ferenc Makk argued that the objectives of gaining hegemony over the Balkans were first felt in Hungarian foreign policy under Béla II. Raimund Kerbl considered that the launch of the Hungarian campaign is connected with the fall of Romanos Diogenes who was deposed in October 1071 after his disastrous defeat and captivity at Manzikert. Accordingly, the Hungarians and Romanos were considered allies during that time and Solomon also sent auxiliary troops to assist the emperor against the Seljuks. Kerbl argued the Hungarian military campaign took place in late October 1071 as a retaliatory campaign against the "usurper" Michael VII Doukas. However, Kerbl incorrectly identified the "Sauromatians", who fought on the side of Romanos at Manzikert according to Michael Attaleiates, with the Hungarians; they were, in fact, Frankish, Norman, and German mercenaries. On the other hand, as Ferenc Makk emphasized, the date of the Hungarian campaign is uncertain: due to the winter conditions of medieval warfare, it is more likely that the attack was launched at the end of August at the latest, during the reign of Romanos Diogenes. Makk argued that the aim of the campaign, beyond retaliation and plunder, was limited territorial expansion along the southern border.

Following preparations, the Hungarian army began crossing Sava, which the Byzantine river fleet tried to prevent upon the order of dux Niketas, the military commander of Belgrade Fortress. The boats of the "Byzantines and Bulgarians", which formed the defensive line along the Danube, used the incendiary weapon of Greek fire to set several attacking ships on fire. However, the crossing Hungarian army was significantly outnumbered, so they successfully broke through the Byzantine river blockade, sinking the imperial ships. The Hungarians then landed on the south side of the river, occupying the border areas.

Siege of Belgrade

The Hungarians soon surrounded the city of Belgrade and laid siege to the fortress. Due to the dire situation, Niketas sent a secret message to the Pechenegs who were performing border duties, asking them to provide assistance in relieving the castle. Kovács argued that these Pechenegs were not the same as those who had raided southern Hungary a few months earlier, sparking the war. The Byzantine commander asked for their help with the deliberate distortion that the city was besieged by only a smaller unit of Vid Gutkeled, as part of an ordinary border conflict to take revenge for the earlier Pecheneg raid. The arriving Pecheneg relief army, led by their chieftain Kazar, was swept away by a single column, the detachment from Sopron County under the command of their ispán Jan. Most of the Pechenegs were slaughtered, only few of them – including Kazar – were able to flee. To deter the castle defenders, the prisoners of war and the bodies of the killed Pechenegs were put on public display.