By John O'Callaghan and Kevin Lim

SINGAPORE (Reuters) - China's leaders face daunting domestic problems and would be wary of any foreign entanglement, and the growth of its military was a reflection of its rise as an economic power, Singapore's foreign minister, K. Shanmugam, said on Tuesday.

President Xi Jinping and other new leaders of China's 1.3 billion people need to restructure the economy to rely more on consumption, clean up the environment and tackle rising income inequality, he said.

"The Chinese leadership know the last thing they need is an external distraction," Shanmugam told Reuters in an interview.

The new leaders of China, who have taken over after a once-in-a-decade reshuffle, are being scrutinized by outside powers as growing economic and military influence propel it to superpower status.

The relationship between the United States and China would define how Asia develops, Shanmugam said.

They have recently exchanged angry accusations over computer hacking, while China, Japan, Vietnam and the Philippines have conflicting claims over various groups of islands.

Singapore, most of whose people are ethnic Chinese, is widely regarded as a U.S. ally, but the wealthy Southeast Asian city-state also has close ties with China where it has invested billions of dollars.

Shanmugam said China's development of its military capabilities was consistent with its growing economic influence.

China was also mindful of how it was nearly swallowed up by Western powers and Japan in the late 19th and early 20th centuries.

"You go to a museum in Beijing you will see a big poster on how many of the Western countries and others combined together and tried to carve China up like a melon. That's deeply ingrained in the Chinese psyche," he said.

"The legitimacy of government in China today has to depend both on economic progress for its people and protecting national sovereignty," he said.

RISK TO BALANCE

Shanmugam said that despite the economic and military competition between China and the United States, and tension in the South China Sea, they "both know that the cooperation is going to be far more important".

Southeast Asia should not have to choose between then, he said.

The 10 members of the Association of Southeast Asian Nations (ASEAN) were making progress towards integrating their economies by 2015, with substantial reductions in tariffs on goods negotiated and efforts now on the services sector, he said.

But as well as the danger of conflict between the United States and China, Southeast Asia faced the danger of conflict within the region of 600 million people over territorial claims.

"One of the things that one can see on the horizon that can throw ASEAN off balance from continued progress in bettering its people's lives is any kind of conflict."

Rival claims would take a long time to resolve but in the meantime, rules, such as a maritime code of conduct (COC), were necessary to ensure free navigation and the flow of trade, Shanmugam said.

"Progress on the COC has not been as good as we had hoped," he said.

"The way to avoid the disputes spilling over into something nasty is to have a code of conduct that would give a framework as to how countries behave with each other, for example in how their ships interact with each other, without having to deal with the underlying issues of sovereignty."

(Editing by Robert Birsel)