In 1389 he started a new civil war, but after an unsuccessful attack on Vilnius he had to seek help from the Teutonic Knights. In 1392 Jogaila and Vytautas signed the Ostrów Agreement, and Vytautas became his regent of the Grand Duchy of Lithuania. The Duchy of Trakai was returned to Vytautas as his patrimony.