A climate change conference being held in Morocco on Monday comes amid a contentious U.S. election in which Democratic nominee Hillary Clinton faces thorny questions over the millions of dollars she received from foreign donors, including King Mohammed VI of Morocco, in a deal recently disclosed by the group WikiLeaks.

The group has been publishing illegally obtained emails from Clinton campaign chairman John Podesta for the last month. New emails disclosed late last month show deliberations among campaign manager Robby Mook, Podesta and deputy campaign chairwoman Huma Abedin over whether Clinton should go to Morocco in 2015 to talk at a Clinton Global Initiative conference focused on climate change and other issues facing Africa and the Middle East.

One of the emails from Abedin showed that King Mohammed donated $12 million to the Clinton Foundation on the condition that she would address the conference, in a quid pro quo. Potential pay-to-play deals between the foundation and Clinton when she was secretary of state have dogged her campaign, with Republican nominee Donald Trump using it to illustrate Clinton's inherent corruption.

Other emails showed Mook raising concerns about her addressing the event at the same time the Wall Street Journal and other news outlets were digging into the Clinton Foundation removing its 2009 ban on accepting foreign donations. Mook suggested that going to Morocco to speak at the event in the spring of 2015 would be troubling so close to the launch of her presidential bid.

"This is why Morocco would be such a problem — more of this the first week she's out selling her story," Mook wrote to Podesta and Abedin in February 2015.

"I hear you," Abedin responded. Soon after, it was arranged that former President Bill Clinton would speak instead.

More than a year later, the events surrounding pay-to-play are now overshadowing the United Nations climate meeting in Marrakesh, Nov. 7-18, which will be used to hash out the details of implementing last year's climate change deal in Paris. Obama officials expect the U.S. election to be on most countries' minds as the administration leads a delegation to Morocco to participate in the talks. Nearly 200 countries are expected to participate in the meeting, along with hundreds of environmental groups and non-governmental organizations.

Many countries that are a party to the conference are concerned that if Trump is elected he would pull out of the Paris deal, and it would spell the end of what many consider a landmark agreement among 196 countries to reduce greenhouse gas emissions to combat global warming. Many scientists blame the emissions from fossil fuels for driving manmade climate change.

Clinton supports the Paris deal, while Trump has made exiting the agreement a top priority if elected on Nov. 8.

"I think there is a great deal of interest, not just domestically, but internationally, in terms of what the election outcome will be," said John Morton, the White House National Security Council's climate and energy director, on a call Thursday with reporters to discuss the opening of the 22nd Conference of the Parties to the United Nations climate framework in Marrakesh.

The Marrakesh meeting gets underway one day before the U.S. elections. In the runup to the meeting, Chinese climate negotiators have come out in a series of rare public statements rebuking Trump's threat of pulling out of the Paris Agreement.

"If Trump were to insist on doing things his own way, then he would pay a heavy price both politically and diplomatically," Zou Ji, who serves as second in command at China's National Center for Climate Change Strategy, said Friday. "The U.S. would suffer the greatest harm and of course, the rest of the world would also be implicated," he said, according to Reuters.

Meanwhile, Moroccan officials have said in recent weeks that putting pressure on developed countries such as the United States to pay for climate change programs in smaller developing countries will be a priority at the meeting.

European foundations planning to attend the climate conference concurred that climate financing will be one of several controversial issues addressed in Morocco. Nevertheless, reaching an agreement will be of crucial importance.

"Many controversial issues are on the agenda such as damages caused by climate change and financing for the poorest countries," said the German-based Heinrich Böll Foundation Friday. "However, COP 22 should not be mistaken for being a summit that will merely deal with technical details of the agreement's implementation. Instead, Marrakesh offers a chance to finally start the transformation towards climate justice and a sustainable future."

It is not clear if representatives from the Clinton Foundation will attend the meeting as thousands of groups that support developing nations will be descending on Marrakesh. Secretary of State John Kerry will be at the climate conference Nov. 15-16, before jetting off to Peru for the Asia-Pacific Economic Cooperation Ministerial Meeting, the State Department said Friday.

"Secretary Kerry will deliver a speech that highlights the urgency of addressing climate change and the importance of continued ambitious climate action around the world," the agency said.

Kerry will be in Oman and the United Arab Emirates, which also have been donors to the Clinton Foundation, before journeying to Morocco.