The Peasants' War in Upper Austria (German: Oberösterreichischer Bauernkrieg) was a rebellion led by farmers in 1626 whose goal was to free Upper Austria from Bavarian rule. The motive (found in the Frankenburger Würfelspiel of 1625) was an escalation of the Bavarian kingdom's attempt to press the country into the Catholic faith at the time of the Thirty Years' War.
In the beginning of the Thirty Years' War, Upper Austria was pledged to the Bavarian Kingdom by the House of Habsburg. The new ruler assumed cuius regio, eius religio (the religion of the ruler dictated the religion of the ruled) and tried to convert the lands to the Catholic faith. In May 1625, the Protestant priest of the Frankenburg am Hausruck parish was replaced by a Catholic priest sent from Bavaria. After an armed uprising, the new priest was forced to flee from the castle. However, the men feared the reaction from Bavaria and surrendered three days later. Adam von Herberstorff, the Bavarian steward of Upper Austria, called all of the men from the region to the Haushamerfeld near Frankenburg to hold the assizes. The 36 men who had led the revolt were among the 5,000 gathered. The court sentenced the men to death, but allowed half of them to go free. Two men would step forward, and one would hang while the other would go. A roll of the dice determined their fate.
The steward had thought that the harsh sentence would frighten the peasants, but it only served to increase dissent and give sympathy to the rebels. Over the next year, the peasants secretly prepared for war by recruiting a man from every farmer's house, supplying them with weapons, and teaching them tactics. They intended to attack on the Pentecost, but war had broken out two weeks earlier, when two Bavarian soldiers tried to steal a cow in Lembach. In response, a number of peasants on a pilgrimage near Lembach quickly assembled to slaughter the Bavarian garrison of 25 men. The group continued to collect more recruits on their way to Peuerbach, where they faced Herberstorff and his men. Even before the full size of the peasant army was assembled in Peuerbach, a number of companies attacked them and were quickly defeated. The new commissioners of the region were elected summarily on the battlefield.