The company said five of its staff died and 32 others were injured in the “unprovoked, criminal attack” in Kabul.
Taliban gunmen entered the contractor’s compound after detonating a car bomb outside the site on Wednesday.
Afghan security forces engaged the attackers in a gun battle to secure the facility.
Four Taliban insurgents were killed, said Wahid Majoroh, a spokesman for the Afghan public health ministry.
The suicide bomb left a large crater in the road and destroyed nearby buildings.
Charlie Burbridge, managing director of G4S Risk Management Group, said: “It is with great sadness that we can confirm that five of our employees were killed and 32 were injured – five of them seriously – in an unprovoked, criminal attack on one of our compounds in Kabul.”
Four of the staff who died were Afghan and one was British, the security outsourcing firm added. They have not been named.
Mr Burbridge added: “Next of kin have been informed and our thoughts at this difficult time are with the loved ones of those who have died and been injured, and our brave team in Afghanistan who have lost colleagues and friends. We are offering support and counselling to all of those affected.
“We would like to extend our heartfelt thanks to the British Embassy, the Foreign and Commonwealth Office, the British and Afghan armed forces, other Nato forces and other private security companies who have all assisted us as we ensure our operations in Kabul are secure and continue safely.
“We are committed to our security role in support of the people of Afghanistan, and we are determined that incidents such as this will not prevent the vital work that the international community conducts from continuing.”
The UK Foreign Office said it was aware of the attack and was working with Afghan authorities to establish further details.
The Taliban carry out near-daily attacks in Afghanistan, where G4S provide security services to a number of bodies including non-governmental organisations and corporate clients.
The secure compound targeted in Kabul on Wednesday is called Camp Anjuman, and is the headquarters of the firm’s security operations in the central Asian country.
The Taliban claimed responsibility the attack in a statement posted on Twitter.
It said the attack was in response to a US air strike which killed 30 civilians, including some children, during a battle between government forces and insurgents in southern Afghanistan hours earlier.
Sixteen Taliban insurgents also died in the fighting in southern Helmand province.
G4S is the UK’s largest private security company, employing 570,000 people worldwide.
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies