The city was founded as a result of the influx of refugees into the marshes of the Po estuary following the invasion of northern Italy by the Lombards in 568. In the mid-8th century, the Venetians resisted the empire-building efforts of Pepin III and remained subject to the Byzantine Empire, at least theoretically. As the community continued to develop and as Byzantine power waned, an increasingly anti-Eastern character emerged, leading to the growth of autonomy and eventual independence. Venice was a city state (an Italian thalassocracy or Repubblica Marinara, the other three being Genoa, Pisa, and Amalfi). Its strategic position at head of the Adriatic made Venetian naval and commercial power almost invulnerable.
In the 12th century the essentials for the power of Venice were laid: the Venetian Arsenal was under construction in 1104; Venice wrested control of the Brenner pass from Verona in 1178, opening a lifeline to silver from Germany; the last autocratic doge, Vitale Michiele, died in 1172.
The Republic of Venice seized the eastern shores of the Adriatic before 1200, mostly for commercial reasons, because pirates based there were a menace to trade. The Doge already carried the titles of Duke of Dalmatia and Duke of Istria. Later mainland possessions, which extended across Lake Garda as far west as the Adda River, were known as "Terrafirma", and were acquired partly as a buffer against belligerent neighbors, partly to guarantee Alpine trade routes, and partly to ensure the supply of mainland wheat, on which the city depended. In building its maritime commercial empire, the Republic acquired control of most of the islands in the Aegean, including Cyprus and Crete, and became a major power-broker in the Near East. By the standards of the time, Venice's stewardship of its mainland territories was relatively enlightened and the citizens of such towns as Bergamo, Brescia, and Verona rallied to the defence of Venetian sovereignty when it was threatened by invaders.
Venice became an imperial power following the Fourth Crusade, which (with Venetian aid) seized Constantinople in 1204 and established the Latin Empire. Considerable plunder was brought back to Venice, including the Winged Lion of St. Mark, symbol of Venice. Only Venetian ships could efficiently transport the men, supplies, and (especially) war horses.
The Venetian governmental structure was a mix of Byzantine and Islamic systems, but the social order was entirely feudal. Church and various private properties were tied to military service, though there was no knight tenure within the city itself. The Cavalieri di San Marco was the only order of chivalry ever instituted in Venice, and no citizen could accept or join a foreign order without the government's consent. Venice remained a republic throughout its independent period and politics and the military were kept completely separate. War was regarded as a continuation of commerce by other means (hence, the city's early production of large numbers of mercenaries for service elsewhere).
The chief executive was the Doge (duke), who, theoretically, held his elective office for life. In practice, a number of Doges were forced by pressure from their oligarchical peers to resign the office and retire into monastic seclusion when they were felt to have been discredited by perceived political failure.
Though the people of Venice generally remained orthodox Roman Catholics, the state of Venice was notable for its freedom from religious fanaticism and it enacted not a single execution for religious heresy during the Counter-Reformation. This apparent lack of zeal contributed to its frequently coming into conflict with the Papacy. Venice was threatened with the interdict on a number of occasions and twice suffered its imposition. The second, more famous, occasion was on April 27, 1509, by order of Pope Julius II (see League of Cambrai).
Venetian ambassadors sent home still-extant secret reports of the politics and rumours of European courts, providing fascinating information to modern historians.
After 1070 years, the Republic lost its independence when Napoleon Bonaparte on May 12, 1797, conquered Venice during the First Coalition. The French conqueror brought to an end the most fascinating century of its history: It was during the "Settecento" that Venice became perhaps the most elegant and refined city in Europe, greatly influencing art, architecture, and literature. Napoleon was seen as something of a liberator by the city's Jewish population. He removed the gates of the Ghetto and ended the restrictions on when and where Jews could live and travel in the city.
Venice became part of the Austrian-held Kingdom of Lombardy-Venetia when Napoleon signed the Treaty of Campo Formio on October 12 1797. The Austrians took control of the city on January 18, 1798. It was taken from Austria by the Treaty of Pressburg in 1805 and became part of Napoleon's Kingdom of Italy, but was returned to Austria following Napoleon's defeat in 1814. In 1866, along with the rest of Venetia, Venice became part of Italy. After 1797, the city fell into a serious decline, with many of the old palaces and other buildings abandoned and falling into disrepair, although the Lido became a popular beach resort in the late 19th century.