Choe Yeong served briefly as the mayor of Pyongyang, where his efforts at increasing crop production and mitigating famine won him even more attention as a national hero. In 1364, he distinguished himself further when he defeated a powerful minister named Deok Heung-gun who tried to overthrow the government of Goryeo for asserting independence from the Yuan dynasty. Choe Yu, appointed by Empress Gi of Yuan, invaded Korea with 10,000 Mongol cavalry to overthrow the rebellious king, but Choe Yeong gathered up his forces and defeated the Mongol Tumen of 10,000, solidifying the final defiance and independence of Goryeo dynasty from the Mongols in 1364.