UN climate talks in Poland were set to drag into the weekend as delegates from the almost 200 countries that signed the Paris accord struggled to reach agreement on the rules to implement the ambitious deal designed to contain global warming. Despite four consecutive all-night negotiating sessions, representatives were on Friday evening still unable to agree on issues such as financial help for poorer countries, a trading scheme for emissions cuts, and how those emissions should be measured.

The summit that began in the city of Katowice on December 3 was set to grind past Friday’s official close and at least into Saturday, forcing some delegates to change their flights so they do not have to leave Poland without reaching agreement. Catherine McKenna, Canada’s environment minister, told the FT that she was “cautiously optimistic” that a deal was in sight. “We need robust rules, that is why we are here. We need rules that apply to everyone.” This year’s summit has been particularly bruising because the 2015 Paris deal that aimed to limit global warming to well below 2 degrees Celsius left the details of how to achieve that to be worked out later.

We’re not prepared to die. We are going to do everything in our power to keep our heads above the water Mohamed Nasheed, former president of the Maldives Yet even as the science of climate change has become more clear, the rise of nationalism in countries from the US to Brazil has weighed heavily on efforts to implement a global deal that would drastically cut emissions.

The US has said it plans to withdraw from the Paris agreement and teamed up with oil-producing Saudi Arabia, Russia, and Kuwait last weekend to block a phrase that would have “welcomed” a UN scientific report commissioned in 2015 on the agreement’s goal to ideally limit global warming to 1.5C. With smog hanging in the air, the setting in Katowice has contributed to a feeling of angst and urgency as negotiations go down to the wire. “There is now an intense shuttle diplomacy going on,” Laurence Tubiana, an architect of the Paris agreement, said of the mood.