 After their defeat at the Battle of Pyongyang, the Beiyang Army made its next stand at the crossing of the Yalu River, the border between Korea and China.On the Chinese side, Qing general Song Qing established his headquarters at the walled town of Jiuliancheng (九連城), and fortified the banks of the Yalu River south to the local district capital of Dandong and north to the village of Hushan (虎山) for about 16 kilometers in either direction with over a hundred redoubts and trenches manned by around 23,000 troops.On the Korean side of the Yalu River, Japanese general Yamagata Aritomo occupied the walled town of Uiju on 23 October 1894 with approximately 10,000 troops of the Japanese First Army, consisting of the 3rd and 5th Divisions.