The history of the Republic of Venice traditionally begins with its foundation at noon on Friday 25 March AD 421, by authorities from Padua, to establish a trading-post in that region of northern Italy; the founding of the Venetian republic also was marked with the founding of the church of St. James. The early city of Venice existed as a collection of lagoon communities who united for mutual defence against the Lombards, as the power of the Byzantine Empire dwindled in northern Italy in the late 7th century. Early in the 8th century, the people of the lagoon elected their first leader Orso Ipato (Ursus), who was confirmed by Byzantium with the titles of hypatus and dux. Historically, Ursus was the first Doge of Venice. Tradition, however, since the early 11th century, dictates that the Venetians first proclaimed one Paolo Lucio Anafesto (Anafestus Paulicius) duke in AD 697, although the tradition dates only from the chronicle of John, deacon of Venice (John the Deacon); nonetheless, the power base of the first doges was in Eraclea.
Ursus's successor, Deusdedit, moved his seat from Eraclea to Malamocco in the 740s. He was the son of Ursus and represented the attempt of his father to establish a dynasty. Such attempts were more than commonplace among the doges of the first few centuries of Venetian history, but all were ultimately unsuccessful. During the reign of Deusdedit, Venice became the only remaining Byzantine possession in the north and the changing politic of the Frankish Empire began to change the factional division of Venetia. One faction was decidedly pro-Byzantine. They desired to remain well-connected to the Empire. Another faction, republican in nature, believed in continuing along a course towards practical independence. The other main faction was pro-Frankish. Supported mostly by clergy (in line with papal sympathies of the time), they looked towards the new Carolingian king of the Franks, Pepin the Short, as the best provider of defence against the Lombards. A minor, pro-Lombard, faction was opposed to close ties with any of these further-off powers and interested in maintaining peace with the neighbouring Lombard kingdom, which surrounded Venice except on the seaward side.