Hundreds of people took part in protests in Malaysia and Indonesia on Friday against the decision of US President Donald Trump to recognize Jerusalem as Israel's capital.

Hundreds of people took part in protests in Malaysia and Indonesia on Friday against the decision of US President Donald Trump to recognize Jerusalem as Israel's capital, prompting the American diplomatic delegations in both countries to issue security alerts for their employees.

In Indonesia, several demonstrators burned the US flag in front of the embassy in Jakarta while they carried banners and emblems of Palestine, condemning Trump's Wednesday announcement, Efe news reported.

"Nahdlatul Ulama condemns the US and Israel for invading Jerusalem," read one of the placards in the protests.

Nahdlatul Ulama is the largest independent Islamic organisation in Indonesia, home to the world's largest population of Muslims.

Jakarta police spokesperson Argo Yuwono said some 500 people had gathered in the capital. No major incident or clashes were reported.

Another group gathered in front of the US consulate in Surabaya, the second-largest city in the country.

In the Malaysian capital of Kuala Lumpur, at least 1,000 people shouted anti-Trump slogans and burnt his photos and effigies near the US embassy.

The protest in Kuala Lumpur was attended by leaders and members of the ruling party United Malays National Organisation as well as other groups representing the majority group of ethnic Malays of Muslim origin and Islamic nonprofits.

The US embassies in both countries asked their citizens to take precautions and avoid the areas where protests were taking place.

Trump on Wednesday broke with international convention in recognizing Jerusalem as the capital of Israel and ordering that the US embassy be moved there from Tel Aviv, an announcement that was met with widespread international criticism and led to increased tension in the region.