The Treaty of Trausnitz, signed at Trausnitz Castle by Frederick the Fair, duke of Austria and Styria, and Louis IV, Holy Roman Emperor, duke of Upper Bavaria, on March 13, 1325 ended the dispute between the two men over the rule of the Holy Roman Empire.
On September 18, 1322, at the Battle of Mühldorf, Louis decisively defeated Frederick and took him captive to be imprisoned at Trausnitz Castle.
In exchange, Frederick agreed to recognize Louis as King of the Romans and to convince his brother Leopold to end his resistance.
Frederick failed to convince Leopold to accept Louis as King of the Romans to make peace.
Louis, impressed, offered Frederick the rule of the Holy Roman Empire jointly with himself.