(CNN) Caught between an ascendent China and an increasingly unreliable United States, Singapore's diplomatic future is at the heart of a debate on who really calls the shots in Asia.

The Lion City has historically had strong relations with both countries, an ally in Asia for Washington during the Cold War and one of China's first partners in their efforts to modernize their economy.

Over the years Singapore has been very good at picking "the middle path" between the two superpowers, analysts tell CNN, balancing their positive relationships with both America and China.

But as new US President Donald Trump's attention drifts and Chinese leader Xi Jinping grows more powerful, Singapore finds itself in a tenuous position.

"If anyone can do this balancing act, Singapore can," Kerry Brown, director of the Lau China Institute at King's College London, told CNN.

"If Singapore can't, no one can."

The mouse who roared

Just seven years ago it seemed like Singapore's path was stable and secure.

"We are in Asia; Asia is booming," Prime Minister Lee Hsien Loong said in an interview in 2010.

"China is a big story and a major trading partner for us, but China is not the whole story ... America plays a role in Asia which China cannot replace, and nobody can replace."

Singapore, which marks its National Day August 9, is politically and geographically unique.

The South East Asian nation, which is home to a majority ethnic Chinese population, is the only country in the world to have both English and Mandarin among its official languages.

With a population of five million, the Lion City is also a international financial hub and a fiercely free market.

As its neighbors have succumbed to successive waves of political and financial turmoil, Singapore has remained prosperous and stable.

"It's a bridge between the West and the East," Wang Yiwei, professor at the School of International Studies at the Renmin University of China said.

In 2015, hundreds of billions of dollars in exports and imports poured through Singapore's teeming waterways, consistently the second busiest container port in the world after Shanghai.

Politically, Singapore regularly punches above its weight. The city state was a founding member of ASEAN, the powerful grouping of south-east Asian nations including Indonesia and the Philippines, and since 2010 has often been invited to participate in G20 events

CNN contacted Singapore's Foreign Minister Vivian Balakrishnan for this story but he didn't respond to a request for comment.

Powerful friends

The country's power doesn't just come from its wealth but also from the powerful friendships it has made with the world's two largest superpowers.

Singapore has close historic and military ties to the United States, forged during the Cold War when former leader Lee Kuan Yew took a firm stand against communism in South East Asia.

"When the United States was fighting the Vietnam war, Singapore offered a place for US troops to come for their vacation, sometimes dock their ships and refuel their aircraft," Chong Ja Ian, associate professor at National University of Singapore's Department of Political Science, said.

US President Donald Trump and Singapore Prime Minister Lee meet at the G20 Summit in Germany, July 8.

Despite Lee's firm stance against communism, Singapore was also quick to embrace China once it began to open up economically in the 1980s under then-paramount leader Deng Xiaoping.

"Singapore seized the opportunity for working with the Chinese ... in terms of friendship it blossomed very quickly, not just because of of the economic opportunities but linguistic similarities that made it a bit easier for them to enter the Chinese market earlier," Chong said.

In 2015, China's Xi demonstrated how highly Singapore sat in Beijing's estimation when he held a landmark meeting with then President of Taiwan Ma Ying-jeou in the city.

The tactic paid off: China and the United States are today two of Singapore's largest trading partners, according to UN numbers.

A full quarter of Singapore's exports, about $60 billion, are destined for China and Hong Kong while $30 billion of its imports flood in from the United States.

"It's very natural ... Singapore is a very important international trade and finance center not only in China but also for other countries (in the region)," he said.

But in the past year, amid the rise of both Trump and an assertive Beijing, Singapore's position has become less simple.

Chinese President Xi Jinping (right) shakes hands with prime minster Lee during the G20 at Hangzhou in 2016.

"China sees Singapore as being too close to America and there's a sense in which that's correct," said Michael Barr, associate professor of International Relations at Adelaide's Flinders University and author of "The Ruling Elite of Singapore."

Barr said Singapore is uncomfortable with the unpredictability of President Trump, whose country the Lion State still relies heavily on for their ongoing security.

"This is their dilemma. There is not a lot they can do about pulling back from America ... (but) they know full well that in the long term they have to orient towards China," he said.

'Cranky bear in a small cave'

As with so much political wrangling in South East Asia, Singapore's problems began with the South China Sea.

Relations between Singapore and China certainly haven't always been smooth. At an ASEAN meeting in Vietnam in 2010, incensed by discussions over the South China Sea, then-China foreign minister Yang Jiechi issued a warning to the Singaporean minister in attendance.

"China is a big country and other countries are small countries, and that's just a fact," he said to the crowded room.

Six years later, Singapore urged China to abide by a UN arbitration on the South China Sea, which was originally filed by the Philippines despite huge protests from Beijing.

China immediately plunged relations with Singapore into a deep chill.

In November 2016, nine of Singapore's armored troop carriers were impounded for two months in Hong Kong on their way back from Taiwan. It was widely seen as a slap on the wrist by Chinese authorities.

But the freeze showed China is fully willing to exercise its ever-growing regional and international power against countries who go against its interests.

"China has reached the stage ... where they feel that they can dictate to smaller powers the relationship they will have with China, and if they wish to exercise levels of independence then China will decide how far they can go," Barr said.

"It will be more and more like living with a cranky bear in a small cave."

The age of Trump

In the past, Singapore's strong security alliance with the United States helped temper concerns regarding China.

But that's no longer the case. "No one (in Asia) really knows what's happening in Washington," explained Brown.

"Singapore are very aware they can't make any assumptions now, their assumption for the past 50 years is that keep close to the Americans no matter what. But now the big boys are acting in a very unpredictable way."

The new US president hasn't visited the Lion State but his Secretary of Defense James Mattis swung by in June for the annual Shangri-La Dialogue Asian Security Summit.

"Once we've exhausted all possible alternatives, the Americans will do the right thing. We will still be there," he said, pledging to stand by Washington's allies in Asia.

But experts have questioned whether the Obama Administration's highly publicized pivot to Asia would survive under President Trump.

There may also be stark policy disagreements between the two countries, on a topic they were previously in lockstep.

Singapore is one of the world's staunchest defenders of the free trade, because without it the tiny city-state would not be able to exist.

"Trump on his own has the capacity to take away any good and sensible reason for Singapore and most of Asia to maintain relations with the US," Barr said.

"If he seriously goes down the path of closing down free trade, putting up obstacles, being an unreliable ally ... I can see not just Singapore but the whole of South East Asia lining up with China."

'Singapore is not unique'

Singapore is not alone in considering what Asia's future will look like with a dominant China and an inward-looking United States.

"Philippines, Malaysia, all across the region there's been a real push (by Beijing)," Brown said. "Singapore is not unique, it's just because Singapore's been so adept at balancing (both sides)."

One of the first signs of a closer relationship between Singapore and Beijing would be any changes to their military exercises with Taiwan, a sensitive topic between the two countries, as China views it as a breakaway province.

Singapore's famous Merlion (C) in front of the city's skyline in February, 2015.

"I think there is an awareness that at the end of the day the relationship with China is so much more important than anything else, in terms of economics, so they might think of this as something of a tradeoff," Brown said.

But already Singapore's rhetoric has begun to change. In his Singapore National Day speech in 2016, Prime Minister Lee's language had come a long way from his 2010 interview, where he said China could never replace the US.

"We are friends with both America and with China ... Both believe the Pacific is vast enough to accommodate both powers and President Xi said recently that America and China should "cultivate common circles of friends," he told his countrymen.

"That is precisely what Singapore's trying to do."