The first righteous armies emerged during the Khitan invasions of Korea and the Mongol invasions of Korea. They subsequently rose up during the Japanese invasions of Korea (1592–1598), the first and second Manchu invasions, and during the Japanese occupation and preceding events.