The earliest settlements, dating from at least the 9th cent., began around the castles standing on top of the Hradčany and Vysehrad hills (on the left and right bank, respectively, of the Vltava) that still dominate Prague's skyline. Already an important trading center by the 10th cent., it achieved real prominence after King Wenceslaus I of Bohemia established (1232) a German settlement there.
Prague grew rapidly in size and prosperity as Bohemia's capital and became under Emperor Charles IV (14th cent.) one of the most splendid cities of Europe. The city's location at the intersection of vital trade routes stimulated its economy, while scholars and students from all over Europe came to its university. From the 14th to the early 17th cent., the emperors of the Holy Roman Empire resided at Prague as well as at Vienna. Rivalry between the Czech and German elements in the city was a major factor in the popular religious reform movement led by John Huss, a professor at the university. Huss, who also condemned the secular power of the Roman Catholic Church, was burned at the stake in 1415; his martyrdom sparked the Hussite Wars. Prague's attempt to follow a moderate course in the wars was frustrated (1424) by an army led by John Zizka.
Hapsburg rule of Prague began in 1526, when the Ottoman Turks were threatening Europe. In the late 16th and early 17th cent., under Emperor Rudolf II, Prague shone as a center of science where the astronomers Tycho Brahe and Johannes Kepler worked. In 1618, when the Protestant Czech nobles felt the liberties of Bohemia threatened by Emperor Matthias, they vented their dissatisfaction by throwing two royal councilors and the secretary of the royal council of Bohemia out of the windows of Hradčany Castle (May 23, 1618). Although none of the victims of the so-called Defenestration of Prague were hurt, the event opened the Thirty Years War. The battle of the White Mountain (1620), fought near Prague, resulted in Bohemia's subjugation to Austrian rule. Until 1860, German was Prague's only official language. The Peace of Prague (1635) failed to end the Thirty Years War, in the last year of which (1648) a section of the city was occupied by the Swedes.
In the War of the Austrian Succession, Prague was occupied by the French (1742) and the Prussians (1744); and in the Seven Years War it was (1757) the scene of a major victory of Frederick II of Prussia. Although it had lost much of its former importance, Prague in the 18th cent. remained a brilliant cultural center. The building activities of Empress Maria Theresa and the great Bohemian nobles gave the city a predominantly baroque and rococo character. The center of the Czech national revival in the 19th cent., Prague played an important part in the Revolution of 1848 until its bombardment and capture by the Austrian field marshal Windischgrätz.
In 1918, Prague became the capital of the newly created Czechoslovak republic. Occupied (1939–45) by the Germans, it suffered hardship in World War II, but little structural damage. Prague was liberated in May, 1945, by Soviet troops after an anti-German rebellion (May 5). In 1968 the "Prague Spring," a brief period of liberal reforms attempted by the government of Alexander Dubček, was ended with the invasion of the Soviet military. In 1989 the city was the scene of massive demonstrations during the "Velvet Revolution," which brought down the Communist regime. With the breakup of Czechoslovakia into the Czech Republic and Slovakia in 1993, Prague became the capital of the Czech Republic.