By Tim Kelly and Nobuhiro Kubo

TOKYO (Reuters) - As the first Gulf War raged in February 1991, Japanese army major Nozomu Yoshitomi was supposed to be playing war games with U.S. officers at a military facility in Tokyo. But the Americans appeared distracted, watching the conflict live on CNN. On another TV, local news showed Japanese troops sculpting ice figures at a snow festival.

"They asked how Japan could be a true U.S. ally if it hadn't sent troops," said Yoshitomi, recalling the shame he felt watching Japanese personnel build snowmen as U.S.-led coalition soldiers fought to evict the Iraqi army from the Kuwaiti desert.

Unable to send troops because of its war-renouncing constitution, Japan, which at the time bought 90 percent of its oil from the Middle East, instead contributed $13 billion to help fund the military operation.

For a generation of Japanese military planners and policymakers including Yoshitomi, who went on to advise the cabinet from 2005 to 2007 before retiring as a major general in April this year, that humiliation was a pivotal moment.

While many assume today's more muscular security policy has been driven solely by conservative Prime Minister Shinzo Abe, interviews with dozens of current and former Japanese military officers and government officials show it has much deeper roots, and is therefore likely to remain robust after he leaves office.

The 1991 experience firmed Japan's resolve to move away from the state pacifism that had defined the country since its defeat in World War Two, the officials involved told Reuters.

"We learnt from the Gulf War that just sending money and not people would not earn us international respect," said Tetsuya Nishimoto, then a senior Japanese Ground Self Defense Force general and now retired.

Abe in September pushed through legislation allowing Japanese troops to fight abroad for the first time since World War Two. But rather than in distant lands, it's in nearby waters that Japan's military is flexing its muscles under an evolving strategy backed by Washington that could counterbalance China's growing naval might.

Story continues

"The roots of Abe's changes lie in the Gulf War, but the driver of change is the serious challenge posed by China," said Yoshitomi, now a professor at Nihon University in Tokyo.

CHINA RISING

While Japanese officers and policymakers felt humiliated by the Gulf War, China was shocked at the scale and precision of U.S. firepower. Soon after, Beijing embarked on a bold program to modernize its military.

Chinese bitterness over Japan's World War Two aggression has grown since Abe - seen by critics as a revisionist who wants to play down the dark side of his country's wartime past - and his Liberal Democratic Party (LDP) returned to power in late 2012.

Sino-Japanese ties have also been frayed by a dispute that flared up shortly before Abe took power, over tiny isles in the East China Sea.

Japan's shift to counter China, however, was well under way before Abe returned to power for a second term in 2012.

In late 2009 the defense, foreign and finance ministers in a government led by the Democratic Party of Japan responded to years of double-digit growth in China's defense spending with a strategy to make the defense of Japanese islands in the East China Sea a priority.

Calls for the shift had emerged under previous LDP administrations, but opposition from military sectors that feared cuts had blocked the change, said Akihisa Nagashima, who was senior vice minister for defense in that DPJ government.

The DPJ also proposed creating a National Security Council, now a key component of Abe's security architecture, and eased a ban on overseas arms sales that Abe fully lifted in April 2014.

"The changes in defense posture weren't made because Abe is prime minister, it was something we had to do. It just happened to be when Abe is prime minister," said LDP lawmaker Ryota Takeda, who served as Japan's Vice Minister of Defence for a year until September 2014.

LEGAL STEPS

Former general Nishimoto was one of many who felt embarrassed by Japan's checkbook diplomacy in 1991.

In January 1991, when Operation Desert Storm kicked off, Nishimoto was at home watching television. As the first cruise missiles slammed into Baghdad, he jumped on a bicycle and rode to defense ministry headquarters in Tokyo.

"I kept thinking this is going to end before Japan is able to do anything," said Nishimoto.

As a direct consequence of that perceived humiliation, Japan in 1992 enacted a contentious law allowing its military to take part in U.N. peacekeeping operations.

Nishimoto, then Japan's army chief, oversaw the dispatch of 600 army engineers to Cambodia to rebuild bridges and roads, and two small contingents to help monitor a peace accord in a country still traumatized by Khmer Rouge rule from 1975-1979.

"That was the starting line," he said.

A year later Nishimoto became chairman of the Joint Staff Office, Japan's most senior military officer.

By 1994 a regional crisis was brewing, with the United States on the brink of war with North Korea after Pyongyang began harvesting weapons-grade plutonium from its Yongbyon nuclear plant.

In preparation for conflict, the commander of U.S. forces in Japan, General Richard Myers, gave Nishimoto requests ranging from shelter for civilians evacuated from the Korean peninsula to security for U.S. bases in Japan that would be used in any attack on the plant.

"We thought it would be doable because it was a basic question of how many blankets, how many tents," Nishimoto said.

But without a legal framework allowing rearguard logistic support even close to home, Nishimoto had to turn down most of what Myers wanted. "The Americans were pounding tables. All we could do was apologize," Nishimoto said.

Diplomacy averted war, but for Nishimoto and other senior officers, the experience was a re-run of the first Gulf War and firmed their resolve to stretch the limits of the constitution.

In 1997, Japan and the United States revised defense cooperation guidelines to expand the scope for Japan's rear support. Two years later, in a further stretching of the limits of the pacifist constitution, parliament passed a law allowing logistics support in areas close to Japan.

A BURDEN LIFTED

After the Sept. 11 attacks, Japan passed another one-off law allowing its tankers to refuel U.S. and other allies' warships supporting the invasion of Afghanistan.

Japan's air force also flew supplies into Iraq from a base in Kuwait in 2003 following the ouster of Saddam Hussein.

Under U.S. pressure to put "boots on the ground", Tokyo also enacted a law permitting the dispatch in 2004 of military engineers on a reconstruction mission in Iraq. Tight curbs on weapons use meant the 550 troops stayed behind the perimeter fence of their base in southern Iraq much of the time.

That same year China overtook Japan to become Asia's biggest military spender, and by last year Beijing was second only to the United States globally, spending more than triple Japan's defense budget.

"The biggest impetus under which the Japanese people are now living is this obvious surge of Chinese power," said Tomohiko Taniguchi, an adviser to Abe on foreign policy.

Laws enacted in September allow Japanese forces to aid friendly countries under attack, relying on the Abe government's reinterpretation of Japan's constitution. Such collective self-defense was banned by previous governments as a violation of the post-war charter.

"For the first time, we are just about to be able to exercise collective defense with the U.S. and others, so the feeling is we have finally been able to get the (Gulf War) burden off our shoulders," said Taniguchi.

In 2012, Kenneth Pyle, then a professor at the University of Washington, described Japan's post-1945 security policy as the "eight noes": no overseas deployments, no exercise of collective self-defense, no power projection capability, no nuclear arms, no arms exports, no sharing defense technology, no military spending above 1 percent of GDP and no military use of space.

Now, says Pyle: "The 'eight noes' are all gone, except the nuclear option."

(Additional reporting and writing by Linda Sieg; Editing by Dean Yates and Alex Richardson)