When Grand Duke of Lithuania Jogaila married Jadwiga of Poland and was crowned as King of Poland in 1386, he appointed his unpopular brother Skirgaila as viceroy for Lithuania. Vytautas seized the opportunity to renew his struggle for power and started the Lithuanian Civil War (1389–92). He allied himself with the Teutonic Knights, promising them Samogitia. However, Jogaila and Vytautas reconciled in 1392 by signing the Treaty of Astrava. The Knights, betrayed by Vytautas, invaded Lithuania in 1394 and unsuccessfully besieged Vilnius for three weeks. The invaders were driven away by joint Lithuanian and Polish forces demonstrating that the old raids were no longer effective against the new Polish–Lithuanian alliance. A truce between the Knights and Vytautas was signed in 1396. Vytautas needed to secure his western front as he was planning a massive campaign against the Golden Horde, which resulted in a disaster at the Battle of the Vorskla River in 1399.