Following its defeat in the Battle of Grunwald in 1410 the Teutonic Order fell into decline, the region of Samogitia was restored to Lithuania, and its Livonian branch joined the Livonian Confederation established in 1422–1435. The Teutonic held lands in Prussia and Pomerania were split in two after the Peace of Thorn in 1466. The western part, with the previously Polish regions of Chełmno Land and Gdańsk Pomerania, was integrated with the Kingdom of Poland as the province of Royal Prussia, the eastern part remained under Teutonic rule, as a fief, also considered an integral part of the Kingdom of Poland. The monastic state was secularized in 1525 during the Protestant Reformation as the Duchy of Prussia, a Polish fief governed by the House of Hohenzollern. The Livonian branch continued as part of the Livonian Confederation until its dissolution in 1561.