 During the 9th century Mazovia was perhaps inhabited by the tribe of Mazovians, and it was incorporated into the Polish state in the second half of 10th century under the Piast ruler Mieszko I.In 1138 the duchy of Mazovia was established, and during the 12th and 13th centuries it joined temporarily various adjacent lands and endured invasions of Prussians, Yotvingians, and Ruthenians.To protect its northern section Conrad I of Mazovia called in the Teutonic Knights in 1226 and granted them the Chełmno Land.