Halberstadt became part of the newly established Kingdom of Prussia in 1701. From 1747 Johann Wilhelm Ludwig Gleim worked here as a government official and made his home an intellectual centre of the Enlightenment ("Aufklärung") movement. Upon the 1807 Treaty of Tilsit, the town became part of the Kingdom of Westphalia, a Napoleonic client-state, and administrative seat of the Westphalian Department of Saale. On 29 July 1809, a Westphalian regiment was defeated by the Black Brunswickers under Prince Frederick William of Brunswick-Wolfenbüttel in the Battle of Halberstadt.