China and Pakistan pledged closer cooperation in fighting terrorism on Thursday amid simmering threats from terrorists in the two countries.
China would like to strengthen cooperation with Pakistan in counterterrorism for stability in both countries and in the region, President Xi Jinping told visiting Pakistani President Mamnoon Hussain.
China supports Pakistan to carry out counterterrorism strategies based on the country's conditions, Xi said in Shanghai.
The meeting came after China was hit by a slew of terrorism attacks recently.
Calling terrorist group the East Turkistan Islamic Movement the common enemy of both countries, Hussain said Pakistan would like to fight it with China.
Pakistan would also take measures to ensure the safety of Chinese personnel and projects in the country, Hussain said.
The two presidents on Thursday also witnessed the signing of an intergovernmental agreement about the orange line of a rail transportation project in Lahore, the second-largest city in Pakistan.
Xi said a bilateral economic corridor is an important part of the Silk Road economic belt and a 21st-century maritime Silk Road proposed by Beijing, urging both countries to further implement a Gwadar port project and the rail link in Lahore.
A corridor connecting Kashgar in China's Xinjiang Uygur autonomous region to the southwestern Pakistani port of Gwadar was proposed in an agreement between the two countries in May 2013.
On Tuesday and Wednesday, Xi, Hussain and other leaders from more than 40 countries and organizations attended a two-day Conference on Interaction and Confidence Building Measures in Asia, in Shanghai.