The Duchy of Estonia was created out of the northern parts of the country and was a direct dominion of the King of Denmark from 1219 until 1346, when it was sold to the Teutonic Order and became part of the Ordenstaat.