Holy Roman Empire from 1181 and again Denmark from 1185, however, local dukes still maintained very close ties with the fragmented Polish realm, and Władysław III Spindleshanks (future Polish monarch) stayed at the court of Bogusław I, Duke of Pomerania in Szczecin in 1186, on behalf of his father, Duke of Greater Poland Mieszko III the Old, who also periodically was the High Duke of Poland. The ducal mint in Szczecin was founded around 1185. Capital of the Duchy of Pomerania (12th century–1630) Szczecin was held by Denmark until 1235, when it fell under the suzerainty of the multi-ethnic Holy Roman Empire. In the second half of the 12th century, a group of German tradesmen (from various parts of the Holy Roman Empire) settled in the city around St. Jacob's Church, which was founded by Beringer, a trader from Bamberg, and consecrated in 1187. For centuries the dukes invited German settlers to colonize their land and to found towns and villages (see Ostsiedlung). Duke Barnim of Pomerania granted a local government charter to a local community in 1237, separating the Germans from the Slavic majority community settled around the St. Nicholas Church (in the neighborhoods of Chyzin, Uber-Wiken, and Unter-Wiken). Barnim granted the city Magdeburg rights in 1243. In 1277 the city purchased the nearby villages, present-day districts, Krzekowo and Osów. In 1278 Szczecin, along with several other cities, was exempted by King Eric V of Denmark from customs duties for a fair organized in Zealand, Denmark. This is the first case of the city's connections with the Hanseatic League. Around that time the major ethnic group of the city had become German, while the Slavic population decreased. In 1273 in Szczecin duke of Poznań and future King of Poland Przemysł II married princess Ludgarda, granddaughter of Barnim I, Duke of Pomerania, in order to strengthen the alliance between the two rulers. From 1295 to 1464 the city was the capital of a splinter Pomeranian realm known as the Pomerania-Stettin. (Its Dukes were Otto I, Barnim III the Great, Casimir III, Swantibor I, Boguslaw VII, Otto II, Casimir V, Joachim I the Younger, Otto III.) In 1478 it became part (and capital) of the reunited Duchy of Pomerania under duke Bogislaw X, and in 1532 it again became the capital of a splinter eponymous duchy. In the 13th and 14th centuries the town became the main Pomeranian centre of trade