Founded in the latter part of the 9th century, Prague soon became the seat of the kings of Bohemia, some of whom also reigned as emperors of the Holy Roman Empire in later times. The city flourished during the 14th century reign of Charles IV, who ordered the building of the New Town, the Charles Bridge, Saint Vitus Cathedral: the oldest gothic cathedral in central Europe which is actually inside the Castle, and the Charles University: the oldest university in central Europe. Prague was then the third-largest city in Europe.