The period of prosperity ended during the catastrophic Swedish invasion of Poland (1655–1660), when Rawa was captured by Swedes (September 8, 1655), who completely destroyed both town and castle (1657). Rawa never recovered from the destruction, and even though it continued to be the capital of Rawa Voivodeship, the town lost importance. In 1676, its population was only 100. In 1702, Swedish forces returned during the Great Northern War, once again destroying the town. One of two main routes connecting Warsaw and Dresden ran through the town in the 18th century and Kings Augustus II the Strong and Augustus III of Poland often traveled that route. In 1766, most of Rawa burned in a fire, and on February 4, 1793, the town was seized by the Kingdom of Prussia during the Second Partition of Poland. In 1800, Rawa County was created, and in November 1806, during the Napoleonic Wars, Prussians temporarily left the town. It became part of the Duchy of Warsaw.