Stephen's brother-in-law, Henry II, became King of Germany in 1002 and Holy Roman Emperor in 1013. Their friendly relationship ensured that the western borders of Hungary experienced a period of peace in the first decades of the 11th century. Even when Henry II's discontented brother, Bruno, sought refuge in Hungary in 1004, Stephen preserved the peace with Germany and negotiated a settlement between his two brothers-in-law. Around 1009, he gave his younger sister in marriage to Otto Orseolo, Doge of Venice (r. 1008–1026), a close ally of the Byzantine Emperor, Basil II (r. 976–1025), which suggests that Hungary's relationship with the Byzantine Empire was also peaceful.
On the other hand, the alliance between Hungary and the Holy Roman Empire brought her into a war with Poland lasting from around 1014 until 1018. The Poles occupied the Hungarian posts along the river Morava. Györffy and Kristó write that a Pecheneg incursion into Transylvania, the memory of which has been preserved in Stephen's legends, also took place in this period, because the Pechenegs were close allies of the Polish duke's brother-in-law, Grand Prince Sviatopolk I of Kiev (r. 1015–1019). Poland and the Holy Roman Empire concluded the Peace of Bautzen in January 1018.