The first documented mention of Rastatt, or in those days called "Rastetten", is in 1084. The town, like so many others in the area, suffered greatly during the Thirty Years War and the other wars that ravaged the area and was completely destroyed by the French in 1689. In 1697, the Italian Master-Builder Rossi was invited to the town by Margrave Ludwig Wilhelm and the construction of the Rastatt Castle was begun. When the castle was completed in 1705, the Margrave moved his government from Baden to Rastatt and the town became the seat of power in the region. Following the death of her husband in 1707, Margravine Sibylla Augusta took over the Margravial rule and began construction of the "Pleasance Favorite". In 1771 the town ceased to be the royal residence.
Rastatt was named the capital of the Murg region in 1811 and was used as a major garrison of the Germanic Confederation. A railway line connecting the city to Oos was first opened in 1844 and the construction of the Rastatt citadel commenced the same year. Following the garrison's refusal of obedience in 1844, the city was attacked by Prussian troops. The siege of the city lasted 22 days, at the end of which 19 rebels were found guilty of treason and executed. The Prussians withdrew from the city the following year. The garrison was removed from the city and the citadel which had been con-structed only a few years earlier was completely dismanfied by 1890.
The city was heavily damaged during WWII and has since been mostly rebuilt.