Ma Shiying (), and others supported the prince Zhu Yousong to take the throne, and Zhu became the Hongguang Emperor of the Southern Ming. For his effort, Ma Shiying won the appreciation of Hongguang and replaced Shi Kefa as the effective head of government. In the face of Li Zicheng's rebel forces and the Qing armies, Shi Kefa advocated the policy of allying with Qing to eliminate the rebels first, then drive the Qing forces back north. However, the officials in the Southern Ming imperial court were disunited as they were more interested in pursuing their personal interests. The Southern Ming gradually weakened under the pressure of internal political struggle and the resignation of several officials. After losing his influence in the imperial court, Shi Kefa requested to be dispatched north to supervise defenses on the northern border. Due to internal conflict among the Ming generals along the border, Shi Kefa was unable to establish a strong defense. In the fourth lunar month of 1645, Zuo Liangyu () led an army from Wuhan to attack Ma Shiying and Ruan Dacheng (). Ma Shiying ordered Shi Kefa to set up defenses at the northern border to resist Zuo Liangyu from the east. Zuo Liangyu was eventually defeated by Huang Degong () while his army surrendered. Xuyi also surrendered to Qing and Sizhou (present-day Tianchang) fell to Qing. Shi Kefa moved back to Yangzhou and continued resisting the Qing invaders there. Defence of Yangzhou In the fifth lunar month of 1645, Qing forces led by the Manchu prince Dodo besieged Yangzhou. Shi Kefa sent a messenger to request reinforcements. His subordinate Liu Zeqing () escaped north to Huai'an, while only Liu Zhaoji () came to Shi Kefa's aid. The Qing regent Dorgon wrote to Shi Kefa, asking for his surrender, but Shi declined. Shi Kefa's response, titled Reply to Dorgon's letter (), was noted for its neither servile nor overbearing tone, and was circulated among later generations. Subsequently, Shi Kefa entrusted his subordinate Shi Dewei (), whom he had adopted as a godson, with his funeral arrangements, saying that he wished to be buried at Plum Blossom Ridge () after his death. On the 24th day, Qing armies bombarded Yangzhou with cannon fire and the city fell that night. Shi Kefa attempted suicide by slitting his throat but failed. He then ordered Shi Dewei to kill him but Shi Dewei tearfully refused