After a series of Mongol invasions of Korea between 1231 and 1281, Goryeo signed a treaty in favor of the Mongols and became a vassal state. Kublai was declared Khagan of the Mongol Empire in 1260 although that was not widely recognized by the Mongols in the west and established his capital at Khanbaliq (within modern Beijing) in 1264.