 The city was founded in 787 in the time of Charles the Great.In 1434 German Emperor Sigismund bestowed municipal rights after the civilians had supported his war against the Hussites.In the course of an administrative reform in Bavaria today's municipality was built in 1818.