On a cold December day in 2017, China's President Xi Jinping welcomed a special guest at the Great Hall of the People: Abdulla Yameen Abdul Gayoom. The President of the Maldives walked along the red carpet with the swagger of a leader in complete control. A week earlier, his government had engineered parliamentary approval of a landmark Free Trade Agreement (FTA) with China, sidelining the opposition. The final deal was to be inked during this visit. Indeed this was a tipping point in the not-so-gradual shift towards China that had been under way in Maldivian foreign policy over the past few years. During the visit President Xi emphatically described Yameen as "a member of the neighbouring extended family of China."

But only two short months later, the bonds between the two nations are unexpectedly put to test.

A constitutional crisis

On February 5, 2018, Yameen declared a 15-day emergency following a Supreme Court order quashing terrorism charges against nine leading opposition figures, including former president Mohamed Nasheed. In a matter of hours, security forces swept across Male, detaining two Supreme Court judges. Other opposition figures, including the country's longest-serving leader Maumoon Abdul Gayoom, were also arrested.

The Maldives was set for elections later this year, but now the country is in the midst of a constitutional crisis. The ripple effects of these events are also being felt across the Indian Ocean, given the ongoing strategic tussle for influence between China and India, which views the region as its traditional sphere of influence.

In that context, Yameen's decision poses an intriguing strategic challenge for Beijing. Understanding this requires a brief examination of China's aims, interests and actions in the region. Speaking at the 19th National Party Congress in October last year, Xi had outlined China's short and long-term goals: to emerge as a leading power in Asia before growing to assume global leadership status by 2050.

Beijing seeks to accomplish this by expanding what it calls its comprehensive national power, leveraging its growing economic strength to deepen strategic engagement with developing countries and increasingly playing an active role in issues of global governance while defining new norms.

It is an ambitious agenda, which requires deft diplomacy in terms of actions and messaging in order to mitigate potential counter-balancing by smaller states and opposition of rival powers.

An increasingly cozy relationship

Applying that model to the Sino-Maldives relationship reveals certain key underlying dynamics. For starters, despite having established formal bilateral ties in 1972, the relationship between the two countries only began to deepen after China opened its first full diplomatic mission in Male in 2011. Since then, it has expanded exponentially, with Xi becoming the first Chinese head of state to visit the Maldives in 2014.

China has already pledged hundreds of millions of dollars in grants. It accounts for nearly one-fourth of all tourists visiting the country. Chinese companies are executing mega infrastructure projects across the archipelago, which is a Belt and Road Initiative (BRI) partner nation. A 2015 amendment to the Maldivian constitution permitting foreign ownership of land was largely seen as a China-focussed move, which was then followed by the 2017 FTA.

For the Maldives, clearly China has become a crucial economic parter. But given the size of Beijing's coffers and its investments in other parts of the world, in pure financial terms, the investments in the Maldives are insignificant. A recent Moody's analysis estimates the Maldives' total foreign direct investment (FDI) in 2017 at roughly $485m. Economics, therefore, is not Beijing's driving motivation. Rather, it is a strategic objective that Xi is pursuing.

Building a blue-water navy that is capable of protecting crucial trade routes, ensuring energy supplies and securing overseas Chinese assets is a stated goal of the PLA's modernisation programme. The Maldives' geographic position, therefore, is key, given that at least one-third of the world's bulk cargo traffic and even greater volumes of oil shipments pass through the Indian Ocean. The first explicit evidence of this agenda was witnessed when three Chinese naval frigates docked in Male in August 2017 for a "friendly" visit.

China between two extreme choices

This increasingly cozy relationship, however, has been rudely interrupted by the emergency. From Beijing's perspective, Yameen has left it with two extreme choices - stand by an ally who's unpopularity at home could stick to you or tilt towards democracy. There is, of course, room for manoeuvre between these two ends of the spectrum, but none of those choices are easy to execute and each will come with their own costs.

For instance, unyielding support by Beijing coupled with an extension of the emergency in the Maldives and further suppression of opposition could force other international actors to intervene. Such intervention can range from imposing political and economic sanctions on the regime to even covert and overt force options. In addition, it could further underscore the logic of engagement under the Indo-Pacific rubric and override sceptical domestic constituencies in each of these states.

The Chinese are also likely to be closely assessing how events in the Maldives are being perceived by its allies and BRI nations. Not standing by a trusted partner could imply adverse signalling for leaders like Nicolas Maduro or Rodrigo Duterte. On the other hand, backing Yameen unconditionally could vitiate political and public perception of China in BRI nations. Moreover, it would further intensify the systemic values competition between China and the West for shaping global norms.

These constraints already appear to be at play in China's actions so far. For instance, Beijing has described, as expected, the emergency as an internal matter and provided cover for Yameen at the UN. But it has also acknowledged India's influence, saying it is in India and China's "common interest" to maintain stability in the Maldives. Beijing also hinted that it will keep its forces away by reposing faith in the Maldivian forces to protect Chinese investments and Foreign Minister Wang Yi has been particular in stressing the "unconditional" nature of China's aid and assistance to the country.

It is evident that there's a delicate balancing act that Beijing must and is attempting to perform. In the long run, it desires a supportive regime in Male. For that, it must keep Yameen in check, cooperate with regional and global powers and avoid alienating the Maldivian people.

The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial stance.