In 1370 King Casimir III of Poland died without a direct heir and passed on the throne to his nephew Louis I of Hungary. This brought the two countries together in a union until Louis died in 1382 and passed the Polish throne to his youngest daughter Jadwiga, whilst his elder daughter Mary took the Hungarian throne. Mary’s husband Sigismund became king of Hungary in 1387. Under the reign of Sigismund, Hungary engaged in various disputes with its neighbours and worked to keep the expanding Ottoman Empire at bay. In 1397, the Christian armies united to assist the Bulgarians against the Ottomans in the Battle of Nicopolis, but were unsuccessful. Despite this, Hungary remained a powerful presence in the region, partly aided by Sigismund’s various other titles, including Holy Roman Emperor which he claimed from 1433 until his death in 1437. Matthias Corvinus also extended Hungary’s territories from 1458–90.