The province had been established in 1269 on lands which until then had been part of the Bohemian Margraviate of Moravia, when King Ottokar II of Bohemia vested his natural son Nicholas I with Opava. Together with the adjacent Duchy of Racibórz it was under the direct rule of a cadet branch of the royal Přemyslid dynasty—unlike most other Silesian duchies ruled by the Silesian Piasts, who nevertheless in large part also had become Bohemian vassals in 1327. Nicholas retained Opava after the last Přemyslid ruler of Bohemia, King Wenceslaus III was killed in 1306. In the following struggle for the Bohemian throne, he backed the claims of the Luxembourg candidate John the Blind, who in turn enfeoffed his son and successor Nicholas II with the Duchy of Opava in 1318. In 1337 Nicholas II also received the neighbouring Duchy of Racibórz upon the death of the last Piast duke Leszek.