Pakistan officials said three gunmen dressed as military officers raided the five-star Pearl Continental Hotel on Saturday, killing three hotel security guards, an employee and a navy soldier in the ensuing gunbattle.
Security forces later killed the three separatist insurgents who had stormed a luxury hotel in the port city of Gwadar 24 hours earlier, the military said on Sunday.
The insurgents had been holed up on the top floor of the hotel after security forces arrived. The forces cleared all guests from the premises while cornering the attackers in a staircase.
"Security forces have completed clearance operation," the military said in a statement, adding all three attackers had been killed.
The Balochistan Liberation Army insurgent group, which says it is fighting what it sees as the unfair exploitation of the province's natural resources, claimed responsibility saying in a statement the attack was aimed at "Chinese and other foreign investors".
Balochistan, which borders both Iran and Afghanistan, is Pakistan's poorest province but has abundant reserves of natural gas and various minerals.
Gwadar is a strategic port on the Arabian Sea that is being developed as part of the $60 billion China Pakistan Economic Corridor, which is itself part of China's Belt and Road infrastructure project.
Prime Minister Imran Khan issued a statement condemning the attack.
"Such attempts, especially in Balochistan are an effort to sabotage our economic projects and prosperity," he said.
One of the hotel security guards was killed while attempting to stop the men from entering the hotel.
The military said the attackers disabled CCTV cameras in the hotel and planted explosives at all access points leading to the top floor.
Separatists in Balochistan have for decades been fighting the central government, bombing gas and transport infrastructure and raiding security posts. Islamist terrorists from various factions also operate in the province.
The separatists have denounced the industrial development plans and vowed to block them while Pakistan has promised China it would protect its investments and Chinese workers.
The Pearl Continental Hotel, on a hillside near the port, is used by foreign guests, including Chinese project staff, but there were none of them in the building at the time of the attack, officials said.
Security across most of Pakistan has improved over recent years following a major crackdown after the country's worst attack, when 148 people, most of them children, were killed in an assault on a school in the western city of Peshawar in 2014.
But Balochistan, Pakistan's largest province, remains an exception and there have been several attacks this year, with 14 people killed last month in an attack on buses travelling between the southern city of Karachi and Gwadar.