In a joint news conference with Japanese Prime Minister Yukio Hatoyama, Obama dismissed claims that his administration was dithering on a new strategy in the eight-year-old war. He said the policy must protect America from terrorist networks, while also making clear there is no "open-ended commitment" to Afghanistan.
Obama also said he will insist that the self-proclaimed mastermind of the Sept. 11 attacks will be subject to "the most exacting demands of justice." An administration official announced Friday that Khalid Sheikh Mohammed and four other Guantanamo Bay detainees will be sent to New York to face trial in a civilian federal court.
Obama and Hatoyama pledged to renew their nations' alliance to keep pace with a fast-changing world.
Opening a weeklong trip to Asia, Obama said the U.S. and Japan must "find ways to renew and refresh the alliance for the 21st century."
Hatoyama noted that Japan will no longer refuel ships that supply Afghanistan, but he promised aid for Afghan civilian needs such as schools, agriculture and police. He also vowed to cooperate with the United States on combatting climate change and nuclear proliferation.
The two leaders are hoping to shore up relations with a nation that vows to be more assertive with the United States, even as Obama also weighs whether to send more troops to the Afghan war.
Obama's visit comes at a time of uncertainty in U.S.-Japan relations. Hatoyama said he would end Japan's Indian Ocean refueling mission that supports U.S.-led forces in Afghanistan and to review an agreement on relocating American troops in Japan that Washington thought was settled three years ago.
Obama also said the U.S. and Japan would work quickly to resolve a dispute over American military bases on Okinawa.
Hatoyama recalled that he had campaigned on the issue of moving the U.S. base away from populated areas. He said the issue had to be settled quickly because delay would only cause the matter to fester.
Both men mentioned the stickiest issue in relations -- the relocation of Marine Corps Air Station Futenma on the southern island of Okinawa -- but offered no details. Hatoyama has suggested moving the base off Okinawa altogether, while the U.S. wants to move it to a more remote location on the island, as part of a 2006 agreement on relocating 47,000 American troops in Japan.
Weighing on Obama as he begins his trip is the pending decision on Afghan war strategy. On a stop at Elmendorf Air Force Base in Alaska on his way to Asia, Obama told a military audience he will commit more forces to Afghanistan only if it is vital to U.S. interests and receives public support.
"I will not risk your lives unless it is necessary to America's vital interests," Obama told the troops.
"And if it is necessary," he said, "the United States of America will have your back. We'll give you the strategy and the clear mission you deserve. We'll give you the equipment and support you need to get the job done. And that includes public support back home."
Afghanistan is a complicating factor in the trip to a rapidly changing Asia reordering itself around China's surging economic and diplomatic clout. Obama's chief goal, the White House has said, is to demonstrate U.S. commitment to the region.
Obama also will travel to Singapore for meetings with Southeast Asian leaders, and then to China and South Korea. Many governments are keen to see a revitalized U.S. engagement in part to counterbalance China, and even a newly powerful Beijing says it welcomes a continuing U.S. role in the region.
Japan, long billed by Washington as the cornerstone of U.S. Asia policy, is caught up in these shifts. Hatoyama came to power calling for a more equal partnership with Washington and a more positive embrace of China, which will soon supplant Japan as the world's No. 2 economy.
In a pre-trip interview with Japan's NHK network, Obama sought to minimize any friction and likened the election of Hatoyama and his Democratic Party of Japan after nearly 50 years of rule by another party to a "political earthquake."
"I think that it is perfectly appropriate for the new government to want to re-examine how to move forward in a new environment," Obama said. "I don't think anybody expects that the U.S.-Japan relationship would be the same now as it was 50 years ago or 30 years ago or 20 years ago."
As part of an effort to shift focus away from difficult security issues, Obama and Hatoyama are expected to discuss and issue a statement on climate change, nuclear disarmament and other global issues. Attempts to coax nuclear-armed North Korea -- which occasionally threatens Japan with fiery rhetoric -- to return to disarmament negotiations are likely to feature prominently, as is Iran's nuclear program.
The Associated Press contributed to this report.