During the Great Northern War (1700–21), the city was besieged by Swedish troops. The restoration of Augustus the Strong as King of Poland was prepared in the town in the Treaty of Thorn (1709) by Russian Tsar Peter the Great. In the second half of the 17th century, tensions between Catholics and Protestants grew, similarly to religious wars throughout Europe in the previous century. In the early 18th century about 50 percent of the populace, especially the gentry and middle class, were German-speaking Protestants, while the other 50 percent were Polish speaking Roman Catholics. Protestant influence was subsequently pushed back after the Tumult of Thorn of 1724.