TOKYO - Worried about North Korean belligerence and an increasingly aggressive China, Japan's military wants to cooperate in unprecedented ways with the United States and is even considering putting its military in the line of fire in areas outside Japan, Japanese defense officials said Thursday.

In an interview, Defense Minister Toshimi Kitazawa said Japan was studying ways to provide U.S. forces with logistical support in case of a conflict on the Korean Peninsula. Japan is also interested, he said, in determining how it can launch missions to evacuate civilians from the peninsula as part of efforts to support a U.S. mission.

In subsequent briefings Thursday, Japanese defense officials acknowledged that such maneuvers could put Japanese troops in harm's way. If attacked, they said, Japanese forces would fight back, which would necessitate more and deeper training with the United States and perhaps South Korea to ensure against casualties from friendly fire.

"The basic principle of Japan is to pursue peace," Kitazawa said, referring to Japan's constitution, which limits its military to the defense of Japan. "But we also need to have measures to avoid being left behind."

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

In October 2009, Gates was gruff with his hosts, telling them to 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 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 he went so far as to acknowledge that the multibillion-dollar base relocation scheme is "politically a complex matter" as he pledged to "follow the lead of the Japanese government" in solving the problem.

Gates came to Japan from China, where he had an eventful three-day visit punctuated by the first test flight of China's stealth fighter. Chinese officials told Gates that the test was not meant to reflect insensitivity toward his visit, which was aimed at restoring high-level military ties with Beijing. But the test flight was seen as an unprecedented statement nonetheless.

Starting in August 2009, U.S. relations with Japan faced an enormous challenge with the election of an opposition party, the Democratic Party of Japan. It ousted the Liberal Democratic Party, which had run Japan almost without interruption since the 1950s. The DPJ came into office with new ideas about moving closer to China and wanting to be 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 simultaneously moving thousands of Marines to Guam. The prime minister at the time, Yukio Hatoyama, had run on a platform of opposing the base deal, which U.S. and Japanese negotiators had been working on since 1996. Hatoyama demanded an investigation.

But Hatoyama, after intense U.S. pressure, pledged on May 28 to carry out the Futenma 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, thanks to increasingly aggressive moves by China and continued provocations by North Korea, the DPJ's strategic thinking shifted back toward Washington. In the space of 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.

Significantly at the time, U.S. officials put China on notice that the United States viewed the Chinese-Japanese dispute over the Senkaku or Diaoyu island chain as covered by the Article 5 military assistance clause of the 1960 U.S.-Japan Treaty of Mutual Cooperation and Security.