Beginning with the reign of Sigismund III Vasa (18 September 1587 – 19 April 1632) Upper Silesia once again caught the fancy of the Polish kings. After the loss of the Swedish throne, the Polish branch of the House of Vasa desperately needed to strengthen their position in Poland, where they were only elected monarchs while in Sweden they had been hereditary rulers. This led to negotiations between Polish and Habsburg emperors concerning Upper Silesia. The main attempt of the Polish diplomats was to obtain Duchy of Opole-Racibórz as an equivalent for the unpaid dowry of Anna of Austria and Constance of Austria both wives of Sigismund III. Initially unwilling to grant any compensation, in 1637 emperor Ferdinand III decided to resume negotiations after France offered Poland the whole of Upper Silesia if it joined France in the war. At this point king Władysław IV Vasa had obtained possession only of several estates scattered throughout Bohemia with no land connection to Poland. The situation changed again when the kingdom of Sweden rejoined the anti-Habsburg coalition and invaded Silesia. Swedish forces captured most of the important cities in Lower Silesia and marched into Upper Silesia. In 1641 Władysław IV began negotiating with Danemark in order to convince this country to join the Habsburgs against Sweden. For his help he demanded that his estates in Bohemia be exchanged for the Duchy of Opole-Racibórz. After heavy defeats in Upper Silesia (loss of Opole, Koźle, Namysłów), Ferdinand III finally agreed to Władysław's proposals in 1644. The agreement signed in 1645 granted Władysław and other successors of his father - Sigismund III - the title of Duke of Opole- Racibórz. The rights of the House of Vasa were to last for 50 years unless the line of Sigismund died out or the duchy was repurchased by the Habsburgs. The reign of Polish kings and princes resulted in a lasting peace in Upper Silesia, because at this point the Swedes did not want open conflict with Poland. This also strengthened economic and cultural ties between Upper SIlesia and Poland. The peace intensified trade and together with tolerance for the local Protestants gained Polish monarchs popularity in Upper Silesia.