In the course of Secularization in 1803, the rights of the Prince-Bishopric of Würzburg in the community, and those held by the Juliusspital, passed to Bavaria, which under the terms of the Peace of Pressburg in 1805 it ceded to the newly formed Grand Duchy of Würzburg. In 1814 the community passed along with this back to Bavaria in 1814. In the course of administrative reform in Bavaria, the current community came into being with the "Gemeindeedikt" (“Municipal Edict”) of 1818.