Six British soldiers have now been killed this year in Afghanistan, where British casualties have slowed over the past year.
Britain has not lost so many soldiers in one incident since six were killed by a similar blast in March last year.
They received immediate medical attention at the scene of the blast in Helmand province yesterday and were evacuated by air to Britain's main Camp Bastion base but could not be saved, the Ministry of Defence (MoD) said.
"We have paid a very high price for the work we're doing in Afghanistan," Cameron told ITV television.
More From This Section
"It is important work because it's vital that country doesn't again become a haven for terrorists -- terrorists that can threaten us here in the UK.
"But today our thoughts should be with the families and friends of those that have suffered."
The three soldiers from the Royal Highland Fusiliers infantry battalion died when their vehicle was hit on a routine patrol in the district of Nahr-e Saraj.
Their families have been told. Their names will be released in due course.
It is the first time since September 2012 that British troops have been killed by a roadside bomb, which have accounted for many of the British deaths in Afghanistan.
There was no immediate claim of responsibility but Taliban militants frequently use roadside bombs against foreign troops and their Afghan allies.
The deaths brings to 401 the total number of British troops killed as a result of hostile action since operations in Afghanistan began in October 2001.
The MoD said that security in Helmand, a hotbed of the Taliban insurgency, was improving but that it remained a risky and dangerous environment for British troops.
Afghan police and soldiers are taking over responsibility for security, but there is growing concern over the war-torn country's prospects after 2014 when all foreign combat deployments will end.