Speaking at a joint news conference with Prime Minister Shinzo Abe after their summit in Tokyo, Obama said the islands in the East China Sea are administered by Japan and therefore fall within the scope of the treaty's Article 5, which obliges the United States to defend Japan.
Obama became the first U.S. president to make such a commitment in public.
The remarks appear to have reassured policymakers in Tokyo that Washington's engagement with Beijing will not come at the expense of Japan and other U.S. allies in Asia.
Abe said he and Obama will instruct senior officials of the two countries to speed up bilateral trade negotiations so that the United States and Japan, the world's largest and third-largest economies, will help achieve an early conclusion to a Pacific trade pact involving 12 economies including Japan and the United States.
Unresolved differences over market access between Tokyo and Washington have prevented the leaders from announcing a breakthrough toward sealing the Trans-Pacific Partnership free trade negotiations.
In a message aimed at restraining the behavior of China and Russia in the East China Sea and Ukraine, respectively, Abe and Obama affirmed the two allies will not tolerate any attempt to alter the status quo by force or coercion.
China has increasingly asserted claims over the Senkaku Islands through measures such as the unilateral declaration in November of an air defense identification zone overlapping Japanese airspace over the islands and repeated intrusions by Chinese patrol ships into Japanese waters around the islets.
Beijing is also flexing its muscles in the South China Sea, where it is locked in territorial disputes with Brunei, Malaysia, the Philippines, Taiwan and Vietnam.
Citing the rule of law, not the use of force or coercion, as the basis for maintaining international order, Abe and Obama also expressed a tough stance over Russia's annexation of Crimea last month and Moscow's alleged involvement in stirring further unrest in eastern Ukraine.
They reaffirmed cooperation with South Korea in curbing North Korea's nuclear weapons and missile development programs, even as Pyongyang is suspected of preparing to conduct a fourth nuclear test.
Obama supported Abe's initiative to enable Japan to exercise the right to collective self-defense -- or defending an ally under armed attack -- as part of Abe's policy of proactively contributing to peace based on the principle of international cooperation.
Abe told Obama that Japan "strongly supports" the U.S. strategic rebalance to Asia and that the Japan-U.S. bilateral alliance is "indispensible and irreplaceable" as a foundation for peace across the region.
Obama responded by saying, "The U.S.-Japan alliance is the foundation not only for our security in the Asia-Pacific region but also for the region as a whole."
Japan is the first leg of Obama's four-nation Asian trip that will also take him to South Korea, Malaysia and the Philippines.
Among other issues, Abe and Obama affirmed bilateral cooperation on global issues such as women's empowerment, development, disarmament and nuclear nonproliferation.
Earlier Thursday, Obama attended a welcome ceremony at the Imperial Palace and met with Emperor Akihito and Empress Michiko. Obama is the first U.S. president to visit Japan as a state guest since Bill Clinton in 1996.