The terrorists hurled grenades at a checkpoint outside the consulate, which lies in an affluent neighbourhood of Pakistan's biggest city.
The attack was claimed by a separatist militant group from Pakistan's southwestern province of Balochistan, which is at the centre of a major Chinese investment project in the country.
Three gunmen and two police were killed in an hour-long shootout near the Chinese consulate in southern port city of Karachi.
A spokesperson for the BLA confirmed there were three attackers.
Two policemen embraced martyrdom in exchange of fire with the three terrorists armed with suicide jackets.
All three were reportedly killed.
"The prime minister has ordered a complete inquiry into the incident and has desired that elements behind this incident must be unearthed", the statement said.
Foreign Minister Shah Mehmood Qureshi told reporters in Islamabad that "all the terrorists have been eliminated", and that all 21 staff at the consulate during the attack had been taken to a safe location.More news: Million Indians will Have Diabetes by 2030: Lancet
Information Minister Fawad Chaudhry condemned the attack on the Chinese consulate in Karachi and labeled it a "conspiracy" targeting Pakistan-China socioeconomic and strategic ties.
Meanwhile, at least nine people were killed and 27 wounded when a blast ripped through a marketplace in Pakistan's restive northwestern tribal region on Friday, officials said. But he said that would not sway China's government and Chinese firms from expanding their footprint overseas, even while they take additional precautions.
"China is exploiting our resources", the group's leader told Reuters.
The security situation has been brought under control and all areas will soon be cleared, he said, adding that a team of police has been deployed inside the consulate.
As one of our loyal readers, we ask you to be our partner.
So far this year, the Baluch Liberation Army has claimed responsibility for 12 attacks against security personnel guarding projects linked to the so-called Chinese Pakistan Economic Corridor as well as to the infrastructure.
On the other hand, imprisoned Opposition Leader in National Assembly, Shehbaz Sharif while condemning the attack said, China is an old ally and friend of Pakistan; enemies' evil designs will be foiled by both the nations. The hospital later said at a news briefing the attack was over.
A suicide attacker on a motorbike set off explosives in a crowded festival and market in northwest Pakistan's Orakzai region, killing at least 25 people at around the same time as the Karachi bloodshed.