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 at least 14 people killed last month in an attack on buses travelling between the southern city of Karachi and Gwadar.