The city's recorded history began in the 8th century as a Lechitic Pomeranian stronghold, built at the site of the Ducal Castle. In the 10th century, Szczecin first became part of the emerging Polish state, and then in the 12th century, its population was Christianised. In the following centuries it was the capital and one of main urban centres of the Duchy of Pomerania ruled by the local House of Griffin, which at various times was under the suzerainty of Poland, the Duchy of Saxony, the Holy Roman Empire and Denmark. After the Treaty of Stettin in 1630, the city came under the control of the Swedish Empire and became in 1648 the capital of Swedish Pomerania until 1720, when it was acquired by the Kingdom of Prussia and then the German Empire. Following World War II the city became part of Poland again in accordance with the Potsdam Agreement, resulting in a nearly complete population exchange. Szczecin was the site of large Polish protests in 1970 and 1980. In 1980, the first agreement between the protesters and the communist regime was signed in Szczecin, which paved the way for the creation of Solidarity, which contributed to the fall of communism in Central and Eastern Europe.