Jogaila was the last pagan ruler of medieval Lithuania. After he became King of Poland, as a result of the Union of Krewo, the newly formed Polish-Lithuanian union confronted the growing power of the Teutonic Knights. The allied victory at the Battle of Grunwald in 1410, followed by the Peace of Thorn, secured the Polish and Lithuanian borders and marked the emergence of the Polish–Lithuanian alliance as a significant force in Europe. The reign of Władysław II Jagiełło extended Polish frontiers and is often considered the beginning of Poland's Golden Age. However it is also known that Jogaila himself knew and spoke in the Lithuanian language with Vytautas the Great.