<P> In the 13th century, the Mongol leader Genghis Khan, once a vassal of the Jurchens, rose up against the Jin dynasty . In the ensuing Mongol conquest of the Jin dynasty, the nomadic invaders avoided direct attacks on the Jin fortifications . Instead, when they could, the Mongols simply rode around the walls; an effective example of this tactic is in 1211, when they circumvented the substantial fortress in Zhangjiakou and inflicted a terrible defeat upon the Jin armies at the Battle of Yehuling . The Mongols also took advantage of lingering Liao resentment against the Jin; the Khitan defenders of the garrisons along the Jin walls, such as those in Gubeikou, often preferred to surrender to the Mongols rather than fight them . The only major engagement of note along the main Great Wall line was at the heavily defended Juyong Pass: instead of laying siege, the Mongol general Jebe lured the defenders out into an ambush and charged in through the opened gates . In 1215, Genghis Khan besieged, captured, and sacked the Jin capital of Yanjing (modern - day Beijing). The Jin dynasty eventually collapsed following the siege of Caizhou in 1234 . Western Xia had already fallen in 1227, and the Southern Song resisted the Mongols until 1279 . </P> <P> With that, the Yuan dynasty, established by Genghis Khan's grandson Khublai Khan, became the first foreign dynasty to rule all of China . Despite being the head of the Mongol Empire, Khublai Khan's rule over China was not free from the threat of the steppe nomads . The Yuan dynasty faced challenges from rival claimants to the title of Great Khan and from rebellious Mongols in the north . Khublai Khan dealt with such threats by using both military blockades and economic sanctions . Although he established garrisons along the steppe frontier from the Juyan Lake Basin in the far west to Yingchang in the east, Khublai Khan and the Yuan emperors after him did not add to the Great Wall (except for the ornate Cloud Platform at Juyong Pass). When the Venetian traveller Marco Polo wrote of his experiences in China during the reign of Khublai Khan, he did not mention a Great Wall . </P> <P> In 1368, the Hongwu Emperor (Zhu Yuanzhang, r . 1368--98) ousted the Mongol - led Yuan dynasty from China to inaugurate the Ming dynasty . The Mongols fled back to Mongolia, but even after numerous campaigns, the Mongol problem remained . </P> <P> During his early reign, Hongwu set up the "eight outer garrisons" close to the steppe and an inner line of forts more suitable for defence . The inner line was the forerunner to the Ming Great Wall . In 1373, as Ming forces encountered setbacks, Hongwu put more emphasis on defence and adopted Hua Yunlong's (華 雲龍) suggestion to establish garrisons at 130 passes and other strategic points in the Beijing area . More positions were set up in the years up Hongwu's death in 1398, and watchtowers were manned from the Bohai Sea to Beijing and further onto the Mongolian steppes . These positions, however, were not for a linear defence but rather a regional one in which walls did not feature heavily, and offensive tactics remained the overarching policy at the time . In 1421, the Ming capital was relocated from Nanjing in the south to Beijing in the north, partly to better manage the Mongol situation . Thus defenses were concentrated around Beijing, where stone and earth began to replace rammed earth in strategic passes . A wall was erected by the Ming in Liaodong to protect Han settlers from a possible threat from the Jurched - Mongol Oriyanghan around 1442 . In 1467--68, expansion of the wall provided further protection for the region from against attacks by the Jianzhou Jurchens in the northeast . </P>

The great wall of china originated under the rule of which of the following dynasties