The city passed to the Electorate of Bavaria in 1803, but two years later, in the course of the Napoleonic Wars, it became the seat of the Electorate of Würzburg (until September 1806), the later Grand Duchy of Würzburg.In 1814, the town became part of the Kingdom of Bavaria and a new bishopric was created seven years later, as the former one had been secularized in 1803 (see also Reichsdeputationshauptschluss).

The former Celtic territory was settled by the Alamanni in the 4th or 5th century, and by the Franks in the 6th to 7th.

Würzburg was the seat of a Merovingian duke from about 650.

The city was the seat of several Imperial Diets, including the one of 1180, in which Henry the Lion was banned from the Empire and his duchy was handed over to Otto of Wittelsbach. The first church on the site of the present Würzburg Cathedral was built as early as 788, and consecrated that same year by Charlemagne; the current building was constructed from 1040 to 1225 in Romanesque style.

The University of Würzburg was founded in 1402 and re-founded in 1582.

In 1817, Friedrich Koenig and Andreas Bauer founded Schnellpressenfabrik Koenig & Bauer (the world's first printing press manufacturer).

On the eve of the Nazis' rise to power, 2,000 Jews lived in Würzburg; it was a community of tradesmen and professionals.The Ravenna Cosmography lists the city as Uburzis at about the same time.Beginning in 1237, the city seal depicted the cathedral and a portrait of Saint Kilian, with the inscription SIGILLVM CIVITATIS HERBIPOLENSIS.The first diocese was founded by Saint Boniface in 742 when he appointed the first bishop of Würzburg, Saint Burkhard.The bishops eventually created a duchy with its center in the city, which extended in the 12th century to Eastern Franconia.The citizens who rebuilt the city immediately after the end of the war were mostly women – Trümmerfrauen ("rubble women") – because the men were either dead or still prisoners of war. Würzburg is located on both banks of the river Main in the region of Lower Franconia in Bavaria, Germany.