An attack on a diplomatic mission in Karachi last week shows the risks Chinese businesses face as they expand across Pakistan in the face of growing resentment over Beijing's influence in the economy.

As Pakistan becomes more indebted to China and an economic crisis worsens, anger is brewing among locals. Pakistani businesses say they are being sidelined in state projects and complain that Chinese firms get preferential treatment from a government desperate for foreign money.

The hostility has now taken a violent turn. Separatist militants attacked the Chinese consulate in Karachi on Friday, killing seven people, the city's second major strike this year on officials from that country. Prime Minister Imran Khan said the perpetrators are trying to scare off Chinese investors and undermine the government's recent trade deals with Beijing.