Whether the "string of pearls" theory is credible or not, China continues to invest in the development of new ports all across the Indian Ocean littoral. After building deep-water sea ports in Gwadar (Pakistan) and Hambantota in Sri Lanka and outlining plans for another in Kyaukphyu (Myanmar), China is now ready to build another at Bagamoyo, on Tanzania's coast.

While these ports are civilian, they also help the Chinese navy operate worldwide. As Xu Guangyu, from the China Arms Control Association, told a Hong Kong newspaper this week, the Chinese navy needs resupply bases as it ventures far from home waters.

China's plans for Bagamoyo came into international view during Chinese President Xi Jinping's visit to Tanzania this week en-route to the BRICS summit. The port at Bagamoyo, which happens to be near the hometown of Tanzanian President Jakaya Kikwete, is expected to cost around $10 billion and would help relieve the pressure on the country's only port in the capital city, Dar es Salaam. A Chinese state-owned company, China Merchants Group, will lead the port construction. Beijing also has plans to develop a special economic zone near Bagamoyo.

Xi signed 16 separate agreements for economic cooperation and sealed what Beijing calls an "all-weather" friendship with Tanzania. China is already Tanzania's biggest trading partner and the second-largest investor. China and Tanzania also have an expanding defense cooperation. China supplies a range of basic military equipment to Tanzanian armed forces. The Tanzanian navy and coast guard are built around Chinese vessels. Chinese trainers stepped in when India pulled out in the 1980s from a military college at Arusha that it had helped set up after the liberation of Tanzania.

Since 2000, when two ships of the Chinese navy called at Dar es Salaam, maritime cooperation between the two countries has steadily expanded. Chinese naval units conducting anti-piracy operations in the Gulf of Aden frequently call on Dar es Salaam.

The discovery of massive natural gas deposits off the coast of Tanzania and neighboring Mozambique has lent a new dimension to China's strategic interest in the waters of East Africa.

The "all-weather" partnership between China and Tanzania has not been built in a day. Political warmth and strategic cooperation between the two dates back to the founding of modern Tanzania by Julius Nyerere in 1964. Nyerere maintained close ties with Beijing at a time when China was isolated and actively campaigned for its entry into the United Nations as a permanent member of the Security Council in the 1960s.

Beijing's support to infrastructure development in Tanzania goes back to the 1960s, when Mao Zedong sent thousands of Chinese engineers and workers to build a railway line between Zambia's interior and Tanzania's coast. The Tanzania Zambia rail system (TAZARA) eliminated Zambia's dependence on South Africa and Rhodesia, then under white minority rule, for the export of its massive copper resources. During his visit to Tanzania, Xi visited the memorial for the Chinese citizens who died in the country during the construction of the railroad.

Xi's political engagements in Dar es Salaam included a meeting with the president of Zanzibar, Ali Mohamed Shein. The Zanzibar archipelago consists of a group of islands off the East African coast. Tanzania was formed in 1964 by a union between Tanganyika and Zanzibar. The archipelago is now an autonomous region within the Tanzanian union. The discovery of massive off-shore natural deposits has generated some friction between the two on the question of ownership, exploitation and use.

There had been some pressure on Zanzibar, especially from Islamist groups on the island, for removing the oil sector from the control of the union. Tanzania and Zanzibar are now negotiating a compromise that will allow the rapid development of the country's hydrocarbon riches.

In his meeting with Shein, who earlier served as vice president of Tanzania, Xi offered assistance in the development of maritime infrastructure and the exploitation of marine resources.

Zanzibar, which has deep historic and cultural links with India was a protectorate of the Raj, and administered from Mumbai until the early decades of the last century. India has much goodwill and many equities in Tanzania and Zanzibar. But they have long ceased to be part of New Delhi's strategic imagination. Might that change as China drops anchor in the western Indian Ocean?

This article was originally published in the Indian Express.