General Yi Seong-gye had gained power and respect during the late 1370s and early 1380s by pushing Mongol remnants off the peninsula and also by repelling well-organized Japanese pirates in a series of successful engagements. He was also credited with routing the Red Turbans when they made their move into the Korean Peninsula as part of their rebellion against the Yuan Dynasty. Following in the wake of the rise of the Ming dynasty under Zhu Yuanzhang, the royal court in Goryeo split into two competing factions: the group led by General Yi (supporting the Ming dynasty) and the camp led by his rival General Choe (supporting the Yuan dynasty).