COLOMBO, Sri Lanka — As the Maldives’ autocratic president, Abdulla Yameen, cracks down on opposition to consolidate power ahead of another election, analysts and diplomats warn that the small nation’s troubles could provoke a larger crisis that draws in China and India, which have long competed for influence in the Indian Ocean region.

Mr. Yameen, who this month declared a state of emergency and rounded up Supreme Court judges and opposition leaders, has cozied up to China. He has invited heavy investment into the Maldives as part of Beijing’s ambitious “One Belt, One Road” initiative, the infrastructure program reviving land and sea trading routes that China is using to spread its influence around the globe.

Mohamed Nasheed, the opposition leader, who has largely lived in exile since his term as the country’s first democratically elected president ended in a coup of sorts in 2012, fears that an expansionist China is propping up Mr. Yameen to lock the country into a “debt trap” — a term that refers to China’s taking over of infrastructure projects when a country cannot pay back its loans, such as the recent takeover of a port in Sri Lanka.

China or any country that tries to “prop up a dictatorship” must realize that such a government will inevitably fall, Mr. Nasheed said in an interview at his home outside Colombo, Sri Lanka’s capital. “And when it does, they will lose.”