In China, Genghis' grandson Kublai Khan declared the Yuan Dynasty in 1271, although his conquest of the preceding Sung Dynasty was not completed until 1279. The Mongols remained in control of most of modern-day China until 1368, when the Yuan forces were defeated by the Ming. The Genghisid rulers retreated to the Mongolian Plateau, where they continued to rule up to 1635.