BANGKOK — As President Barack Obama prepared Sunday to become the first U.S. president to visit Burma, he defended his decision to make such a historic trip even as deadly ethnic violence continues in the Asian country long viewed as a pariah state.

“This is not an endorsement of the Burmese government,” he said, speaking in Thailand. “This is an acknowledgment that there is a process under way inside that country that even a year and a half, two years ago nobody foresaw.”

Speaking during his first stop on a four-day swing through Asia, Obama said Burma’s leaders have made major reforms and the time is right to try to push the process forward.

“We’ve seen political prisoners released. There is an articulated commitment to further political reform,” Obama said at a joint press availability with Thai Prime Minister Yingluck Shinawatra. “But I don’t think anybody is under any illusion that Burma’s arrived, that they’re where they need to be. On the other hand, if we waited to engage until they had achieved a perfect democracy, my suspcicion is we’d be waiting an awful long time.”

Obama said the United States will respond to any “backsliding” in Burma, but that failing to recognize the changes under way right now would be a mistake.

“I’m not somebody who thinks that the United States should stand on the sidelines and not want to get its hands dirty when there’s an opportunity to encourage the better impulses inside a country,” the president said.

Whether wise or unwise, the president’s groundbreaking visit to Burma — the centerpiece of his brief journey to Asia — is also being upstaged by the violence thousands of miles away in the Middle East.

The trip to Thailand, Burma and Cambodia had the potential to be a post-election, international victory lap for Obama, but will now take a more subdued tone as television and newspapers reporting on his visit do so alongside images of hospitals receiving casualties and families taking cover as rockets shower Israel and bombs rain down on Gaza.

In response to a reporter’s question Sunday, Obama made his first comments on the escalating violence. He firmly endorsed Israel’s right to defend itself against rockets originating from Hamas-controlled Gaza, but he seemed eager to avert the looming possibility of a ground incursion into Gaza by Israeli troops.

“Israel has every right to expect that it does not have missiles fired onto its territory. If that can be accomplished without the ramping up of military activity in Gaza that’s preferable,” Obama said. “That’s not just preferable for the people of Gaza. It’s also preferable for Israelis, because if Israeli troops are in Gaza, they’re much more at risk of fatalities or being wounded.”

In a briefing aboard Air Force One as Obama flew to Asia, the White House acknowledged that part of the president’s attention is likely to remain on the Mideast violence even as he is feted in the Asian capitals of Bangkok, Rangoon and Phnom Penh.

“I would anticipate that he’ll continue to work on it,” Deputy National Security Adviser Ben Rhodes said of the Mideast crisis. “He’s being regularly briefed on it. It’s possible that he’ll make calls. We’ll obviously keep you updated. He’s made a regular series of calls on this since it began.”

Even as Obama was in the air en route here, his handling of the Mideast crisis came under attack from one of the most prominent figures in the news business, News Corp. Chairman and CEO Rupert Murdoch.

Murdoch’s meaning was not entirely clear, since there are no reports that Egypt has shelled Israel during the current crisis. However, he appeared to be referring to the ideological solidarity between the new Muslim Brotherhood-led government in Egypt and Hamas leadership in control in Gaza. Egypt’s prime minister visited Gaza last week in a gesture of support for Hamas and the area’s residents. Much of Hamas’s weaponry is also believed to be smuggled in from Egypt.

It’s unclear if Obama considers Egypt’s leaders, including Prime Minister Mohammed Morsi, to be friends. In an interview in September, Obama equivocated about whether Egypt is an ally of the United States. But he spoke with Morsi twice last week to urge him to make efforts to “de-escalate” the confrontation between Israel and Hamas, the White House said.

The kind of split-screen, multi-tasking diplomacy Obama is facing on his Asia swing is tricky, but the president must be getting used to it.

As he kicked off a trip to Latin America last year, he was simultaneously giving the go-ahead for military strikes on Libya’s air defenses. Throughout the visit, White House aides stressed that Obama was being regularly briefed on the Libya operation, even during fancy official dinners. The ongoing military operation created diplomatic tension, since some of his hosts did not approve of the NATO-led action which had the stated goal of preventing then-Libyan leader Muammar Qadhafi from massacring civilians.

In April of this year, when Obama visited Colombia for an international summit meeting, U.S. news coverage of his trip was almost completely hijacked by a salacious scandal involving about a dozen Secret Service personnel who were sent home after allegedly bringing prostitutes to hotel rooms in Cartagena.

As National Security Adviser Tom Donilon previewed the Asia trip in a speech last week, he stressed that it’s important for the president to keep his eyes on strategies like his so-called pivot of U.S. foreign policy towards Asia, even as he struggles to respond to the crises of the moment.

“One of the great challenges in the implementation and execution of foreign policy is to prevent the daily challenges, cascading crises from crowding out the development of broader strategies in pursuit of the United States’ long-term interests,” Donilon said at a Washington-based foreign policy think tank, the Center for Strategic and International Studies.

Just after landing in Bangkok on Sunday, Obama toured one of the city’s iconic sights: the Wat Pho temple. He and Secretary of State Hillary Clinton, who flew in from earlier talks in Singapore and Australia, removed their shoes in accordance with local custom as they took a look at the temple’s main attraction: a massive reclining Buddha. The pair then stopped at a nearby hospital to visit Thailand’s ailing king, Bhumibol Adulyadej.

Later in the day, Obama held brief talks with Shinawatra before attending an official dinner sponsored by the Thai government.

On Monday morning, the president is slated to depart on his historic but brief visit to Burma, also known as Myanmar. He’s to meet with the president of that once reclusive, but now reforming, country, before paying a visit to longtime dissident Aung San Suu Kyi at her home.

Late Monday, Obama is set to make history again by becoming the first president to set foot in Cambodia. He’s scheduled to fly on to Phnom Penh to attend two summits of Asian leaders and have side discussions with Chinese Premier Wen Jiabao and Japanese Prime Minister Noda before departing for the United States on Tuesday.

During his stop in Bangkok, Obama said in response to a question that he did not think the U.S.’s struggles to resolve its budget issues should lead developing nations to conclude that they’ll develop more successfully if they stick with more authoritarian forms of government.

“Yeah, democracy’s a little messier than alternative systems of government, but that’s because democracy allows everybody to have a voice and that system of government lasts and it’s legitimate and when agreements are finally struck you know that nobody’s being left out of the conversation. And that’s the reason for our stability and our prosperity,” Obama said.