The history of Trieste began with the formation of a town of modest size in pre-Roman times, which became an actual city only after Roman conquest in the second century BC and subsequent colonisation. After the imperial era, the city declined following barbarian invasions, becoming only marginally important for the next millennium. It changed lordships several times and then became a free city, which joined the House of Habsburg in 1382. Between the 18th and 19th centuries Trieste experienced a new period of prosperity thanks to the free port and the development of a thriving shipping industry that made it one of the most important cities of the Austrian Empire (since 1867 Austria-Hungary).
The cosmopolitan city, which in the Habsburg period remained Italian-speaking and rose to become a leading Italian and European cultural center, was incorporated into the Kingdom of Italy in 1922 following the First World War. After the Second World War it was the capital of the Free Territory of Trieste, staying for nine years under Allied Military administration. Following the 1954 London Memorandum, Trieste was annexed by Italy. Since 1963 it has been the capital of the Friuli-Venezia Giulia.