As China watches Afghan peace talks founder and Islamic militants make inroads in parts of its troubled neighbor, Beijing is taking its most concrete steps yet toward assuming a direct security role in the country.

In recent weeks China has pledged $70 million in military aid to Afghanistan and proposed a four-nation security bloc including Pakistan and Tajikistan. The partnership — floated by top Chinese Gen. Fang Fenghui and endorsed by Afghan President Ashraf Ghani in Kabul last month — would see China help coordinate efforts to fight terrorism on its back doorstep.

The moves signal growing concern in Beijing that nascent peace talks between the Afghan government and the Taliban could fail, providing a safe haven for Uighur militants or Islamic State group-linked fighters who might seek to plot attacks on China. They dovetail with a broader foreign policy revision under President Xi Jinping, who has shown a willingness to expand its security presence in Africa and the Middle East to protect growing overseas Chinese interests.