Thanks to these reforms and improvements, the Qing government gained a major advantage over domestic rebels. After vanquishing the Taiping in 1864, the newly equipped armies defeated the Nian Rebellion in 1868, the Guizhou Miao in 1873, the Panthay Rebellion in Yunnan in 1873, and in 1877 the massive Muslim uprising that had engulfed Xinjiang since 1862. In addition to quelling domestic revolts, the Qing also fought foreign powers with relative success. Qing armies managed to solve the 1874 crisis with Japan over Taiwan diplomatically, forced the Russians out of the Ili River valley in 1881, and fought the French to a standstill in the Sino-French War of 1884–1885 despite many failures in naval warfare.