When Vietnam was awarded a multibillion-dollar deal by a group of nine wealthy nations last year to work on reducing its use of coal, it agreed to regularly consult with nongovernmental organizations.

Instead, the government has arrested several prominent environmentalists from those organizations who shaped policies that helped secure the funding, prompting concerns over sending money to countries that have violated human rights.

As the country prepares to announce how it will spend the money at the United Nations climate talks that begin on Thursday, activists are saying that Vietnamese officials need to be held accountable for what they are calling a harsh crackdown against those who speak out about the country’s environmental woes.

Ngo Thi To Nhien, the director of an energy think tank, was the sixth environmental campaigner to be detained in the past two years.

She had met with officials from the Ministry of Natural Resources and Environment in March to discuss a plan for the climate deal, the Just Energy Transition Partnership, an effort among the United States, Japan and other developed countries to persuade developing economies to abandon coal. The nine nations had announced in December that Vietnam would receive $15.5 billion in grants and loans in exchange for a commitment to renewable energy.

Ms. Nhien, 48, never got the chance to see Vietnam present the plan. She was arrested in September and remains in a detention center on a charge of “appropriating documents of agencies and organizations.”

The other five who were detained were charged with tax evasion, which rights groups say are trumped-up accusations in response to their advocacy. Four were tried in closed hearings that lasted less than a day each, and given jail time, punishments more severe than the norm. While two activists have since been released, the United Nations high commissioner for human rights said in September that the “prosecutions and the arbitrary application of restrictive legislation are having a chilling effect” on environmentalists in Vietnam.

Activists and academics say that Vietnam appears to be emboldened by its growing importance to the West and has taken the opportunity to clamp down, knowing there will be few repercussions. The country has presented itself as an increasingly important geopolitical player, and one of the few Southeast Asian nations that has publicly pushed back against China. President Biden visited Vietnam in September, elevating ties to a new strategic relationship that he said would “be a force for prosperity and security in one of the most consequential regions in the world.”

“We’re dealing with a juggernaut,” said Phil Robertson, the deputy director of Human Rights Watch’s Asia division. “They have run the table on the international community, and they’re continuing to do so.”

He pointed to Vietnam’s invitation to the Group of 7 summit this year, its inclusion on the Human Rights Council and now the funding from the Just Energy Transition Partnership, despite the country’s troubling human rights record.

Since 2016, when Nguyen Phu Trong, the general secretary of the Communist Party of Vietnam, was re-elected, the space for civil society has shrunk immensely. The country has the second-highest number of political prisoners in Southeast Asia, with more than 160 people currently detained for exercising their basic rights, according to Human Rights Watch.

The authorities in Vietnam have long persecuted people who are viewed as overt threats to one-party rule. But Mr. Trong’s administration has gone much further, targeting people who were previously given some room to operate.

Vietnam rejects any suggestions that the prosecutions are politically motivated. Pham Thu Hang, a spokeswoman for the Vietnamese foreign ministry, said last month that the environmentalists’ cases were “investigated, prosecuted and tried in accordance with the provisions of Vietnam law.”

All six ran organizations that were outspoken about the country’s environmental problems. That advocacy ultimately put them on a collision course with the Communist Party.

Their detentions are a signal that the government wants the energy transition to be carried out on its own terms and not on the advice of groups they have long deemed suspicious, said Nguyen Khac Giang, a visiting fellow at the ISEAS-Yusof Ishak Institute, a research organization in Singapore.

On the day Ms. Nhien was detained, Nhan Dan, the official newspaper of the Communist Party, criticized foreign donors who had funded policy research, saying they had directed groups to publish reports with “one-sided, negative content, tarnishing the situation of the country and the people of Vietnam.”

Vietnam, a manufacturing powerhouse that is home to nearly 99.5 million people, is the ninth-largest coal consumer globally. In 2021, Prime Minister Pham Minh Chinh vowed that the country would phase out coal consumption by 2040.

The Just Energy Transition Partnership was first awarded to South Africa in 2021 as part of an effort by wealthy countries to address longstanding inequities in tackling climate change. Activists now see Vietnam as a litmus test for future agreements. Should other repressive governments be given billions of dollars? Should there be specific requirements for countries that receive funding but have poor human rights records?

Several countries behind the climate deal have expressed concern about the detentions in Vietnam, but rights groups say those nations need to predicate their financial support on the release of the environmentalists or a pledge from the government that there will not be additional arrests. So far, the countries have been unwilling to do so, said Ben Swanton, a director at The 88 Project, a U.S.-based nonprofit that focuses on human rights issues in Vietnam.

In one of the harshest penalties in Vietnam for someone convicted of tax evasion, Dang Dinh Bach, 45, was given a five-year sentence in January 2022. He ran a law and sustainable development policy research center that provided legal aid to communities.

Mr. Bach refused to plead guilty. Tran Phuong Thao, his wife, said that she was not allowed to attend his trial and that he has been assaulted in prison by police officers.

“People like my husband have made great efforts to support the government and give suggestions on energy transition policies,” Ms. Thao said.

The arrest of Ms. Nhien, the think tank director, was particularly unusual because she was not a government critic. She led the Vietnam Initiative for Energy Transition Social Enterprise, the first group in the country to specialize in energy transition.

A former civil servant, Ms. Nhien had worked as a consultant at the World Bank and the Southeast Asia Energy Transition Partnership, a program managed by a U.N. infrastructure agency. She championed policymaking based on scientific evidence and was invited in May to speak to the Ministry of Science and Technology of Vietnam. In June 2020, she organized a workshop on integrating renewable energy sources into the country’s grid, presenting information from the state electricity utility.

That was enough to make her a target. On Sept. 15, four days after Mr. Biden left Vietnam, she was detained. The Ministry of Public Security pointed to the workshop as evidence of her “appropriating internal documents.”

Two weeks later, a court in Ho Chi Minh City sentenced Hoang Thi Minh Hong, 51, one of Vietnam’s best-known environmentalists, to three years in prison for tax evasion.

Ms. Hong’s husband, Hoang Vinh Nam, called his wife’s trial a sham and said the tax department did not send anyone to testify against her. When her peers started being arrested two years ago, Ms. Hong called the tax bureau to ask whether she owed anything and was assured that she did not, he said.

In December, Ms. Hong decided to shut down her environmental nonprofit, citing government pressures. She was arrested in May.