Sri Lanka's newly elected president Maithripala Sirisena arrives at the Election Commission office in Colombo on January 9, 2015 (Agence France-Presse photo)

On a Sunday four months ago, a vessel pulled unannounced into Sri Lanka's Colombo harbor: the Chinese Navy submarine Great Wall No. 329, which is designed to carry torpedoes, a cruise missile and a 360-pound warhead.Sri Lanka's defense minister shrugged it off as an "operational goodwill visit." But anxiety was already radiating as far as New Delhi, where the visit was seen as a clear declaration that China had arrived in India's backyard - with the blessing of Sri Lanka's president at the time, Mahinda Rajapaksa.Whatever China's long-term plans were for strategically important Sri Lanka, they met with a sudden obstruction Friday morning, when Rajapaksa was voted out of office in a startling upset. ( Sri Lanka Verdict: Maithripala Sirisena Trounces Mahinda Rajapaksa, Sworn-In as President David Brewster, a visiting fellow at the Strategic and Defense Studies Center at the Australian National University, said that was the price to be paid for dealing with a government that had increasingly centralized power."You think you only need to deal with one guy," he said, "and then if you lose that one guy, it has a serious impact on the relationship."Sri Lanka's alliance with China built gradually, during the years when Western nations excoriated Rajapaksa over his human rights record and China soothed him with billions of dollars in loans for new ports and roads. The relationship seemed to intensify in recent months, prompting fears in neighboring India that, despite vigorous official denials, Rajapaksa was ready to break with tradition and allow Sri Lankan territory to be used for Chinese military activity. ( PM Modi Writes Letter to Sri Lanka's President-Elect Maithripala Sirisena Chinese-funded infrastructure projects were among Rajapaksa's central accomplishments.Gleaming modern cranes stand in a row at the waterfront in Colombo, the capital, where, in September, President Xi Jinping of China began construction of a $1.5 billion "port city" including malls, hotels and marinas, part of a constellation of Chinese investments that represent an estimated $4 billion in loans. So many Chinese construction crews have begun work in Sri Lanka that one newspaper reported a surge of interest in studying Mandarin by locals who hope to land work as interpreters.But the Chinese projects are also the focus of irritation. Before Xi's September visit, The Sunday Times, a Colombo-based newspaper, wrote that secrecy and the rapid pace of Chinese building "fuel conspiracy theories and genuine fears alike that, to put it mildly, Sri Lanka is in China's pocket." Voters complained that, grand as they appear, the building projects were largely carried out by Chinese workers. Opposition leaders warned their audiences about the country's mounting debt to China.Maithripala Sirisena, who was sworn in as president Friday evening, warned during the campaign that Sri Lanka would "become a colony, and we would become slaves" if Rajapaksa's policies continued for another six years. ( Former Sri Lankan President Mahinda Rajapaksa to Continue in Mainstream Politics: Aide "The land that the white man took over by means of military strength is now being obtained by foreigners by paying ransom to a handful of persons," he wrote in his manifesto.Last month, Ranil Wickremesinghe, who was sworn in as prime minister on Friday, said he would cancel the planned $1.5 billion port city, and Harsha de Silva, economic affairs spokesman for the opposition United National Party, said the new government planned to review all major infrastructure projects for "irregularities."This position, he said, does not indicate "any misgivings or bad blood with China.""We consider China a good friend; it just happens that many of these projects in question happened to be Chinese," he said. "We will have a balanced approach between India and China, unlike the current regime, which was antagonizing India almost by its closeness to China."One reason Rajapaksa drew so close to China was that the country's traditional donors, like the United States and Canada, had harshly criticized his government's conduct in its war against Tamil rebels, and cut back on aid. As the West drew back, China stepped in, both rich and easygoing on human rights. ( Sri Lanka President Mahinda Rajapaksa Concedes Defeat to Challenger Sirisena in Election It was also eyeing a much greater role in the Indian Ocean. Sri Lanka is a linchpin in one of Xi's key foreign policy projects, a maritime trade route intended to connect China and Europe, known as the "Silk Road." The plan, backed by a $40 billion fund, is viewed nervously by India as an encircling strategy that could undermine its own dominance in the region and conceivably culminate in the construction of Chinese military facilities.India's prime minister, Narendra Modi, reacted to the election's outcome with notable enthusiasm Friday, placing a congratulatory call to Sirisena before the votes were all counted.Chinese analysts, for their part, said they did not expect Rajapaksa's defeat to disrupt Chinese plans in Sri Lanka. ( Mahinda Rajapakse 'Pressed' Army After Sri Lanka Poll Defeat: Government "Many politicians say one thing before elections and do another thing after they are elected," said Wang Dehua, a specialist in South Asia at the Shanghai Institutes for International Studies.As for the port city project, he said: "I believe that it brings benefits to Sri Lanka, so why would they cancel it? I think the possibility of cancellation is small."In fact, China has repeatedly weathered similar waves of populist resentment in some other countries where it invested heavily, said Jonathan Holslag, the head of research at the Brussels Institute of Contemporary China Studies, who has studied China's response to coups in five African countries. ( John Kerry Praises Sri Lankan President for Conceding Defeat Typically, China responded to those political transitions by maintaining a low profile for several months, then approaching the new leadership with proposals for joint initiatives, he said. It almost always worked, even with opposition leaders who had harshly criticized China."They all, in one way or another, turn to China, because it was the only player ready to help them finance infrastructure and public spending," he said. "I assume that this is going to happen with Sri Lanka."He added, though, that discomfort with Chinese loans is likely to spread throughout Asia, as people register "the difference between credit and real aid."With the swearing-in of a new president in Sri Lanka, various governments will see an opportunity to reset their relationship with the island nation. Among them is the United States, which "really dealt themselves out of" any kind of influence in Sri Lanka by taking a tough line on rights abuses during the civil war, and would have remained marginalized "for many, many years to come" had Rajapaksa won, said Brewster from the Australian National University.This time, he said, Washington should be prepared, perhaps with its own investment program.

© 2015, The New York Times News Service

"There has been an underestimation of the power of Chinese money, the simple and pure power, and how much of it they are willing to throw around the region," he said. "I talk to people in the strategic community within these countries, people who tend to be well disposed toward the West, and they simply regard the U.S. as nothing.""It's simply that money talks," he said.