The Prime Minister promised British help to increase security at airports in Bali and Jakarta and around 50 Indonesian police officers will be trained in counter-terrorism techniques in the UK.
Speaking at the presidential palace in Jakarta, Mr Cameron said IS, also known as Isil, was an “evil threat” faced by both nations.
His comments came after he indicated he could take military action against Islamic State in Libya or Syria if there was an imminent threat to British lives.
Fears have grown in recent weeks about IS’s activities in Libya following reports that Seifeddine Rezgui, the gunman who carried out the Tunisian beach resort massacre, trained at a terror camp in the country.
The Prime Minister indicated he wanted to work with allies to establish a stable government in Libya. “We should be working and are working with other partners to help the new Libyan government as it gets formed. So that’s helping with advice and support and capacity-building in their government departments,” he said.
“The problem in Libya has been they haven’t had a government that has been able to deliver, and that should be our focus. That is why, for instance, we tried helping with training military personnel, so we should go on doing all of these things.”
Although a military campaign is not being proposed by the UK against IS targets in Libya, Mr Cameron indicated he would be prepared to act if it was necessary in an emergency.
He said that “if there is a threat to Britain, to our people, our streets, and we are able to stop it by taking immediate action against that threat – I’m the British Prime Minister, I would always want to try and take that action and that’s the case whether that problem is emanating from Libya, from Syria or anywhere else”.
Mr Cameron told reporters accompanying him on his tour of south-east Asia: “What I have said with respect to Libya, or indeed anywhere else, is if there is a plot under way where I believe British citizens are in danger of being targeted, if it’s possible to take action to stop that, I would.
“That is legal, that is right, that is proper and that’s the role of the Prime Minister.”