The history of Prague begins with the Castle, founded in the 9th century. Its commanding position above the Vltava made it the center of the lands ruled by the Přemyslids. The Castle has been rebuilt many times, most notably by Charles IV. Since 1918, it has been the seat of the president of the Republic.