The suicide blast on Monday in Peshawar struck inside a police compound as hundreds of officers gathered for afternoon prayers, AFP reported.
The city's police chief said Tuesday that the attack was revenge for the force's frontline operations against extremist militants.
In a call with Pakistan’s President Arif Alvi on Wednesday, Xi said China “opposes all forms of terrorism and strongly condemns the incident”, according to state broadcaster CCTV.
Beijing “will continue to firmly support Pakistan in promoting its national counter-terrorism action plan, maintaining social stability and protecting the safety of the people,“ Xi said.
China and Pakistan are longtime allies, with their leaders frequently hailing what they call an “iron brotherhood”.
In recent years, Beijing has financed development projects in Pakistan and worked with Islamabad to combat terrorism and improve security.
But sporadic attacks on Chinese citizens have also taken place, including a suicide bombing last year targeting staff at a Confucius Institute in Karachi.