The islands of the Venetian lagoon were first settled during the barbarian invasions of the 5th and 6th centuries AD, when the people of the Veneto mainland sought refuge in the marshy region. The refugees built watery villages on rafts of wooden posts driven into the subsoil, laying the foundations for the floating palaces of today. The traditional date of Venice's birth is given as 25 March 421, but there is little evidence to support this belief.
Settlement became focused on the Rivo Alto (later known as Rialto, the highest point in the lagoon), and Venice slowly evolved into a republic. Lip service was paid to the Byzantine Empire, formerly the Eastern branch of the Roman Empire, and the first of Venice's eventual 118 doges (chief magistrates) was elected in 697. Venice's name became inextricably linked with that of St Mark when the apostle's earthly remains were spirited out of Alexandria by merchants in 828. The holy relics were eventually brought to rest in the purpose-built St Mark's Basilica, which was consecrated in 1094.
The Repubblica Serenissima (Most Serene Republic) provided ships for Pope Urban II's First Crusade of 1095, which degenerated into the rape and pillage of the Byzantine Empire and Jerusalem. This ignominious event was but a tea party compared to the Fourth Crusade of 1202, which saw the Venetians plunder and eventually rule Constantinople. Famous booty included the four gorgeous horses, bejewelled Pala d'Oro altarpiece and array of marble statuary that decorate St Mark's Basilica. Venice now commanded a thriving and expanding commercial empire, with the banner of St Mark flying over the bulk of the eastern Mediterranean. Meanwhile, the checks and balances of Venice's government fell into place, overseen by the Great Council made up of members of the city's powerful and moneyed families.
Venice's rapid expansion had not gone unnoticed by its competitors, in particular the similarly maritime city of Genoa. Despite various inconclusive battles and peace treaties, the two navies pursued each other around the Mediterranean with growing fury but little definitive success until Venice's victory in the Battle of Chioggia in 1380. Venice then turned its sights to the mainland, acquiring self-sufficiency and allies to bolster its population, which had been decimated by the Black Death in 1348. Trade continued to flourish, but the Turks' capture of Constantinople in 1453 spelt the beginning of the end of Venice's dominance.