Vytautas was born about the year 1350 in the castle of present-day Old Trakai (Senieji Trakai), on the territory of the Grand Duchy of Lithuania. He was the son of Kęstutis, Duke of Trakai, and his second wife Birutė from western Samogitian region of Lithuania. Prior to her marriage to Kęstutis, Birutė guarded an eternal flame in a pagan sanctuary on a hill near today's town of Palanga on the Baltic Sea coast. Vytautas was Birutė's oldest son. Vytautas' uncle Algirdas had been Grand Duke of Lithuania until his death in 1377. Algirdas and Vytautas' father Kęstutis had ruled jointly, with Algirdas governing the east and Kęstutis the west, primarily responsible for defense against the Teutonic Order. Vytautas was a cousin and childhood friend of Jogaila (Władysław II Jagiełło), who became King of Poland in 1386.