TOKYO - Japan's military, citing worries about North Korean belligerence and an increasingly aggressive China, wants to cooperate in unprecedented ways with the United States and is even considering a departure from its long-standing policy against putting its troops into the line of fire in areas outside Japan, Japanese defense officials said Thursday.

In an interview, Defense Minister Toshimi Kitazawa said Japan was studying how to provide U.S. forces with logistical support in case of a conflict on the Korean Peninsula. It is also trying to determine how it could launch missions to evacuate civilians from the peninsula in support of a U.S. operation, he said.

In subsequent briefings Thursday, Japanese defense officials acknowledged that such undertakings could put Japan's troops in harm's way. If attacked, they said, the troops would fight back, although the Japanese constitution limits the military to defending the country and the prospect of combat would require more and deeper training with the United States and perhaps South Korea.

"The basic principle of Japan is to pursue peace," Kitazawa said. "But we also need to have measures to avoid being left behind."

Kitazawa's statements, made during a visit here by Secretary of Defense Robert M. Gates, underscore a significant improvement in relations between the United States and Japan since the last time Gates visited, in October 2009. They also highlight a substantial risk that Japan is taking, moving to bolster its military profile in a region with strong memories of World War II.

During his 2009 visit, Gates was gruff with his hosts, telling them it was "time to move on" with a controversial plan to build a new facility on Okinawa in exchange for the Marine Corps vacating the Futenma air base, which is located in the middle of a city of 80,000. But Thursday, Gates described ties with Tokyo as "very healthy and on a positive track" and pledged to "follow the lead of the Japanese government" in solving the base problem.

Speaking at a joint news conference with Kitazawa on the fourth day of a trip encompassing Beijing, Tokyo and Seoul, Gates pledged U.S. support for South Korea in the event of another North Korean attack and called on all the countries in the region to work together to forestall it.

"I think the key on the Korean Peninsula, as I discussed in China and discussed here in Japan, is to prevent another provocation from happening," he said.

Starting in August 2009, U.S.-Japan relations faced an enormous challenge with the election of the opposition Democratic Party of Japan, after a half-century of almost uninterrupted rule by the Liberal Democratic Party. The DPJ took office with ideas about moving closer to China and becoming a more equal partner with the United States.

First on the DPJ's agenda with Washington was the Futenma air base program - a multibillion-dollar scheme that involved relocating the Marine Corps air station to a more isolated spot on the island of Okinawa while moving thousands of Marines to Guam. Then-Prime Minister Yukio Hatoyama had run on a platform of opposing the base deal, which U.S. and Japanese negotiators had been working on since 1996, and he demanded an investigation.

But Hatoyama, after intense U.S. pressure, pledged in May to carry out the deal, although he provided no timetable. Soon after, he quit and was replaced as prime minister by the generally more pro-American Naoto Kan.

At the same time, increasingly aggressive moves by China and North Korea shifted the DPJ's strategic thinking back toward Washington. Within several months, China dispatched a naval convoy through Japanese waters and buzzed two Japanese warships with its helicopters. A Chinese fishing vessel rammed Japanese coast guard cutters off the shores of a disputed island chain. When Japan arrested the Chinese fishing captain, China erupted in a paroxysm of anger that essentially forced Japan to release him.