JAKARTA (Reuters) - Indonesia said on Monday it had made urgent requests for an explanation why its military chief was barred from traveling to the United States, as anger simmered in the world's largest Muslim-majority country over the diplomatic incident.

Armed forces commander General Gatot Nurmantyo was stopped on Saturday from boarding an Emirates flight to the United States, despite having a visa and an official invitation to a conference from his counterpart, the chairman of the U.S joint chiefs of staff, General Joseph Dunford.

Foreign Minister Retno Marsudi said she had accepted an official apology from the deputy U.S. ambassador in Jakarta but awaited a detailed explanation.

"We conveyed that we still await clarification, an explanation why this happened," Marsudi told reporters after meeting the U.S. envoy.

"There is a sense of urgency to this that we have conveyed to them," she said, adding that U.S. officials were "trying to coordinate with relevant authorities in the U.S. to find out what really happened."

U.S. Defense Secretary Jim Mattis apologized for the incident to his Indonesian counterpart, Ryamizard Ryacudu, on the sidelines of an ASEAN meeting in the Philippines, and the two were photographed shaking hands.

"I can confirm that he did a pull-aside with the Indonesian minister and expressed regret and apologized for the inconvenience," Captain Jeff Davis, a spokesman for Mattis, told Reuters.

In a statement, the U.S. embassy in Jakarta said: "This issue has been resolved. There is no restriction on General Gatot's travel and we look forward to welcoming (him) to the United States."

Indonesia generally enjoys good ties with the United States. But relations have sometimes been strained over U.S. resource companies operating in Indonesia or alleged rights abuses involving Indonesia's military.

'SECURITY PROTOCOLS'

It was not immediately clear whether Nurmantyo, who has made official visits to the United States before, would attend the conference as scheduled on Monday and Tuesday.

In Washington, U.S. Homeland Security Department spokesman Dave Lapan said the U.S. embassy in Jakarta had told Nurmantyo's office that he might be delayed in boarding his flight because of unspecified "U.S. security protocols."

Lapan said the U.S. government was unable to resolve the problem before Nurmantyo arrived at the airport and he was denied boarding. The general was eventually cleared and booked on another flight but "he chose not to travel," Lapan added.

"The U.S. government is dedicated to ensuring that all persons traveling to the United States are screened and properly vetted. We regret that the passenger and his wife were inconvenienced," Lapan said in an emailed statement.

The spokesman declined to respond to a question about the security protocols that led to Nurmantyo being denied boarding, saying: "We’re not able to discuss the specifics of individual cases."

Some Indonesians reacted indignantly to the incident, putting up banners around the capital calling for the U.S. ambassador to be expelled and for Americans to be "sent home".

Former Indonesian Ambassador to the United States Dino Patti Djalal called for a stronger government reaction.

"The government should not be asking for a clarification, but rather conveying a protest to the U.S. side," he said on Twitter.

Nurmantyo has frequently courted controversy in Indonesia over what analysts perceive to be his political ambitions. He has been accused of whipping up nationalist sentiment by promoting the notion that Indonesia is besieged by "proxy wars" waged by foreign states looking to undermine the country.

This month, Indonesian President Joko Widodo said the armed forces should stay out of politics and ensure their loyalty was only to the state and the government - a statement many believed referred to Nurmantyo's actions.

Nurmantyo is due to retire next March and many expect him to run for vice president or even president in 2019.