The Napoleonic invasion of Switzerland in 1798 severely damaged the town. Under the Helvetic Republic Aarberg was included in the Zollikofen District, though this only lasted until 1803. After this Aarberg became the capital of the "Bezirk" or county of Aarberg. During the Paris July Revolution, in 1830, the commanders of the Swiss Army moved to Aarberg. The fortified town was a key strong point on the western border between Geneva and Basel.