Media playback is unsupported on your device Media caption David Cameron: "I want to see trade links grow... because that means more jobs back home"

The UK and Indonesia have agreed measures to counter the "shared enemy" of Islamic State (IS) extremism, PM David Cameron has said.

The PM, who is in Indonesia for a four-day tour of the region, said 50 police officers from the country will be given counter-terrorism training in the UK.

Mr Cameron promised UK help to increase airport security in Bali and Jakarta.

Earlier, he said he was willing to take military action in Libya, or anywhere else, if there was a threat to Britain.

He told reporters: "If there is a threat to Britain - to our people, to our streets - and we are able to stop it by taking immediate against that threat, as prime minister I will always want to take that action.

"And that's the case whether the problem is emanating from Libya, Syria or anywhere else."

Meanwhile, the BBC's Jon Donnison said the case of British woman Lindsay Sandiford - who has been on death row in Indonesia since 2013 for smuggling £1.6m worth of cocaine - was potentially awkward for Mr Cameron.

The British prime minister has said he will listen to her family's concerns and raise the matter during his trip.

'Evil threat'

Speaking at the presidential palace in Jakarta, Mr Cameron, who met with Indonesian President Joko Widodo, said IS posed an "evil threat" faced by both nations.

"We have agreed to step up our joint efforts both to tackle the terrorist threat and to counter the extremist narrative," Mr Cameron said.

He said the UK would "seek to learn" from Indonesia's approach to countering extremism "with an exchange programme between religious and community leaders here and in the UK to foster a better understanding of what works".

IS and other militant groups have been using propaganda in local languages and their support is thought to be growing internationally.

The threat from terrorism will also be discussed with Malaysian Prime Minister Najib Razak later in the tour.

Image copyright EPA Image caption David Cameron met Indonesian President Joko Widodo on the first day of his tour

The prime minister has been accompanied on the trade mission by 31 British business leaders.

Trade deals worth some £750m ($1.2bn) could be made on the trip, Mr Cameron said.

He said he wanted to forge links with the South East Asia's rapidly growing markets for British goods and services.

Business Secretary Sajid Javid is leading a separate delegation to the region from the north of England.

Analysis

Image copyright Reuters

By Ben Wright, BBC political correspondent

The prime minister's crammed itinerary will take in Indonesia, Malaysia, Vietnam and Singapore on a whistle-stop trade mission, the first of this Parliament.

While the EU remains Britain's biggest trading partner, Mr Cameron has been clear the UK needs to look beyond Europe, an ambition mirrored by frustration at the EU's level of competitiveness and regulation.

Last week, he said Britain needed to go "to the ends of the earth" to sell its wares.

The prime minster is sending a clear signal Britain must look east.

Not just to India and China, but to the largely untapped potential of South East Asia as well. By 2030, the region is expected to be the fourth-largest single market in the world.

Read more from Ben

The UK prime minister said: "Over the next 20 years, 90% of global growth is expected to come from outside Europe, and Britain must be poised to take advantage.

"That's why I'm delighted to be taking British businesses to this vast and dynamic market, securing deals worth over £750m and creating opportunities for hard-working people back at home.

"We can also open up more markets for British businesses by leveraging the power of the EU's single market with 500 million consumers to secure bold, ambitious trade deals with these fastest, growing economies."

During the trip, Mr Cameron is expected to push for progress on a free trade deal between the European Union and South East Asian trading bloc, Asean, which Downing Street believes could provide £3bn a year to the British economy.

Mr Cameron said he would be making the case for an EU-Asean deal in talks with the group's secretary general, Le Luong Minh.

Business leaders accompanying Mr Cameron include:

Philip Bouverat, from JCB

John Nelson, from Lloyd's of London

Ann Cormack, from Rolls-Royce

Leo Quinn, from Balfour Beatty

Mark Wilson, from Aviva

Paul Kahn, from Airbus Group UK

Vivienne Stern, from UK Higher Education International Unit

Sir Martin Sweeting, from Surrey Satellite Technology

It will be the first time a British prime minister has visited Vietnam and the headquarters of the Association of Southeast Asian Nations (Asean) - which promotes economic and trade growth among its 10 member states - in Jakarta, Indonesia.

Conservative MP Richard Graham has been appointed as a trade envoy specifically for the Asean economic community, which is due to be established by the end of the year, alongside the similar role he plays in Indonesia.

The UK government will also make up to £1bn available to finance infrastructure projects in Indonesia through its export guarantee scheme.

It hopes the financing could pave the way for growth of £200m worth of exports to the UK.