LAMU, Kenya — Across a narrow channel from this historic port town, where baobabs tower over the forest and tiny crabs skitter in and out of the mangroves, Kenya could soon get its first coal-fired power plant, courtesy of China.

The plan’s champions, including senior Kenyan officials, say the plant will help meet the country’s fast-growing demand for electricity and draw investment. Its critics worry that it will damage the area’s fragile marine ecosystem, threaten the livelihoods of fishing communities and pollute the air.

The battle over the project, which is frozen pending the outcome of a court case, reverberates far beyond Lamu, a 700-year-old Indian Ocean port town of coral-lime houses and carved wooden doors that has been designated a Unesco world heritage site.

The plan embodies a contradiction of Chinese global climate leadership: The country’s huge coal sector is turning outward in search of new markets as coal projects contract at home. A Chinese multinational is tapped to build the $2 billion, 975-acre project, and a Chinese bank is helping to finance it. The project is among hundreds of coal-fired power plants that Chinese companies are helping to build or finance around the world.

It represents a test for Kenya as well. While its leaders describe the Lamu plant as a source of cheap, reliable electricity, the country is also seeking to become a renewable energy hub, with huge solar and wind projects in the works and a promise to cut greenhouse gas emissions by 30 percent by 2030.

Coal could upend those goals.

“I see no reason for them to do it,” said Erik Solheim, head of the United Nations Environment Program, which is based in the Kenyan capital, Nairobi. “They should invest heavily in hydro, solar, wind. They are already, but they could do even more.”

Not least, Mr. Solheim said in an interview, the rapidly falling price of renewable energy sources makes a coal-fired power project “much less viable.”

The port town of Lamu, established in the 14th century within an archipelago of small islands near Somalia, is among the oldest continually inhabited places on Africa’s Indian Ocean coast. Arab traders sailed here in their wooden dhows on their way south to Zanzibar. They brought dates and steel utensils from Arabia; they took back mangrove logs and cowrie shells.

All morning long, along the old town seafront, men unload mangrove logs and palm fronds. Fishers bring in their catches. No cars are allowed in the old town. The only taxis in its narrow lanes are donkeys. The once-thriving tourism industry has shrunk sharply because of a series of attacks by the Somalia-based terrorist group known as the Shabab.

To get to the coal plant site from Lamu town, you have to hire a boat to cross the channel and then drive along a sandy path. Cashews grow amid the wilderness. There are patches of sesame, kitchen gardens of watermelon and papaya, and a lot of uncertainty in the air. No one here has seen a coal plant before. No one really knows how it will affect them.

Shebwana Mohammed, an 18-year-old who was riding his bicycle near the project site, said he felt a mixture of worry and hope. “If it comes with a job I’m ready to take it,” he ventured.

An older man, Mohammed Shee, who grows cassava and cashews on the edges of the plant site, said he had lost a few trees when the road was built. He didn’t know what to make of the project, though he said he worried about the forest. “If the trees dry up how will a farmer survive?” he wondered aloud.

Whether Kenya needs coal-fired electricity is a matter of dispute, with some energy analysts concluding that wind and geothermal sources could generate enough electricity and be more cost-effective.

Then, there is the matter of where the coal would come from. The plant developer, a Kenyan consortium called Amu Power, plans to import coal initially; only later would a Kenyan coal mine, far in the country’s interior, come online.

The environment secretary at the Kenyan Environment Ministry, Alice Akinyi Kaudia, was skeptical of the project’s utility, saying that it would be “counterproductive” to her country’s commitment to reduce emissions under the Paris climate accord.

The Lamu project has backing at the top of the government, though.

A lawsuit by a local group, filed in November 2016 in Kenya’s National Environmental Tribunal, has stopped construction in its tracks. For now, no smokestacks tower over the baobabs; the only signs of construction are concrete discs that demarcate the forest and farmland acquired for the plant.

In court documents, the national environmental management authority, which reviews the impact of development projects, said it had approved the project. It maintained that “all environmental concerns were considered and mitigation measures were recommended,” and asked that what it called the “misconceived” lawsuit be dismissed.

For its part, Amu Power said that the plant would offer what Kenya needs most to attract investment: electricity to power a big road-and-rail project to connect its landlocked neighbors to a new port, also under construction in Lamu.

The plant would use seawater for cooling. The discharged water, said Cyrus Kirima, the company’s chief operating officer, would be warmed by about 5 degrees Fahrenheit but would not harm marine life.

As for its carbon footprint, Mr. Kirima was eager to point out that Kenya’s greenhouse gas emissions are a fraction of the levels of industrialized countries.

“You need to do business,” Mr. Kirima said. “You need investment. It’s not as though Kenya is out in top gear to build coal plants.”

The same cannot be said for China, though.

According to the Global Coal Tracker, a monitoring group, more than 200 coal-fired power plants are being developed or financed by Chinese companies from Mongolia to Zimbabwe, including in countries that, like Kenya, had previously burned no coal.

Power China, the Chinese multinational in line to build the Lamu plant, has also constructed coal plants in Indonesia and Pakistan. Urgewald, a tracking group that pushes for divestment from the coal sector, lists Power China as the 12th-largest developer of coal plants in the world.

“As China has reduced its dependence on coal domestically it has expanded overseas, to relieve excess domestic capacity,” said Katharine Lu, who researches energy investments at Friends of the Earth, an environmental lobby group.

Beyond excess coal, geopolitics is also a key factor in that expansion. China’s Belt and Road Initiative is a central part of President Xi Jinping’s strategy to increase his country’s global influence through infrastructure projects abroad. The United States, for its part, continues to export coal, as coal-fired power plants shrink at home.

In Lamu, another constituency stands to gain, at least in the short-term: An estimated 600 households whose land has been acquired for the project are in line for financial compensation, which helped to explain why Abdul Rahman Abdi, a local mangrove timber dealer, was bullish on the idea.

Mr. Abdi bought 19 acres within the project site three years ago. He said he had been reassured by government officials — the deputy president, William Ruto, came to Lamu to speak to residents — that the project would enrich rather than damage the area. “They assure us they’re going to bring a lot of money with this project,” he said. “They assure us that they’re not crazy.”

Mr. Abdi has paid a personal price in the fight over the plant. He has fallen out with a lifelong friend, Walid Ahmed Ali, who has spent the last two years roaming from island to island with Save Lamu, the group that is suing to stop the project, telling people that a coal plant could ruin their air and water and ultimately their livelihoods.

It is not a popular position, Mr. Ahmed Ali and his colleagues acknowledge. People call them names. Friends dismiss them as enemies of progress. Even a few relatives turn their backs.

Compared to the compensation money on the table, their warnings about the future seem vague.

“This is the only place we call home, the only place we have relatives and families,” Omar Elmawi, the national liaison officer of Save Lamu said in his second-floor office. Its walls are plastered with maps of the region, marked by symbols of natural riches: coral, lobster, sea cucumber.

“You can never get enough compensation to evacuate everyone,” he said.