MADRID — Global climate talks lurched to an end here Sunday with finger-pointing, accusations of failure and fresh doubts about the world's collective resolve to slow the warming of the planet — at a moment when scientists say time is running out for people to avert steadily worsening climate disasters.

After more than two weeks of negotiations, punctuated by raucous protests and constant reminders of a need to move faster, negotiators barely mustered enthusiasm for the compromise they had patched together, while raising grievances about the issues that remain unresolved.

The negotiators failed to achieve their primary goals. Central among them: persuading the world’s largest carbon-emitting countries to pledge to tackle climate change more aggressively beginning in 2020.

“We are not satisfied,” said Chilean Environment Minister Carolina Schmidt, who chaired the conference. “The agreements reached by the parties are not enough.”

Delegates from nearly 200 nations wrestled for more than 40 hours past their planned deadline — making these the longest in the 25-year history of the talks.

As officials scrambled to finalize a complex set of rules to implement the 2015 Paris climate accord, a handful of higher-emitting countries squared off against smaller, more vulnerable countries. Negotiators were at loggerheads while crafting rules around a fair and transparent global carbon trading system, and they pushed the issue to next year. Fights also dragged on about how to provide funding to poorer nations already coping with rising seas, crippling droughts and other consequences of climate change.

The painstaking pace of the U.N. Framework Convention on Climate Change, or COP25, stood in contrast to the mass demonstrations and vehement pleas from young activists, some of whom staged protests inside the conference hall and accused world leaders of neglecting the most significant challenge facing humanity.

“This is the biggest disconnect between this process and what’s going on in the real world that I’ve seen,” said Alden Meyer, director of strategy and policy for the Union of Concerned Scientists, who has been attending climate talks since the early 1990s.

“You have the science crystal on where we need to go. You have the youth and others stepping up around the world in the streets pressing for action,” he said. “It’s like we’re in a sealed vacuum chamber in here, and no one is perceiving what is happening out there — what the science says and what people are demanding.”

Sunday’s outcome underscored how international divisions and a lack of momentum threaten the effort to limit the warming of Earth and avoid dangerous levels, only four years after the Paris agreement produced a moment of global solidarity.

“The can-do spirit that birthed the Paris agreement feels like a distant memory today,” Helen Mountford, vice president for climate and economics at the World Resources Institute, said in a statement Sunday.

The lack of progress in Spain sets up a critical moment ahead of next year’s gathering in Scotland, where countries will be asked to show up with more ambitious pledges to slash their carbon footprints.

But Sunday’s conclusion raised new doubts about whether key nations would rise to that challenge. Already, many countries are not keeping the promises they made in Paris in 2015, when leaders pledged to limit global warming to “well below” 2 degrees Celsius (3.6 degrees Fahrenheit) — and to try to remain below 1.5 degrees Celsius.

The world already has warmed more than 1 degree Celsius above preindustrial levels, and current pledges would put the planet on a trajectory to warm more than 3 degrees Celsius by the end of the century.

In Madrid, small and developing countries accused the United States and others, such as Brazil and Australia, of obstructing key parts of the negotiations and undermining the spirit and goals of the Paris accord. Countries already hard hit by climate change argued that large emitters continue to dawdle, as other imperiled nations face intensifying cyclones, increased flooding and other climate-related disasters.

“This is an absolute tragedy and a travesty,” Ian Fry, the climate change ambassador from the Pacific island nation of Tuvalu, told fellow negotiators. Fry specifically pointed to the United States for playing a destructive role in the talks.

The United States is in its final year as part of the international agreement it once helped spearhead. The Trump administration has said it officially will withdraw from the Paris accord on Nov. 4, 2020 — the day after the U.S. presidential election.

As delegates voted on the final texts, many seats were empty: Some negotiators, tired and, with flights to catch, had simply gone home. Those who remained had technical trouble retrieving the documents, even as they voted on them, and continually stopped the proceedings to say they needed help.

“If you refresh, maybe?” Schmidt proposed from the dais.

Later, as countries were offering statements, Norway’s climate minister offered the floor to a 24-year-old member of the delegation who had taken a 2½ -day train ride to Madrid to reduce her carbon footprint.

“Our leaders need to step up,” Sofie Nordvik said. “Please use our solutions.”

The conference was not envisioned as a landmark moment in the implementation of the Paris accord. Negotiators had been asked to iron out a set of complex but important details about how the deal will be implemented.

U.N. Secretary General António Guterres spent much of this year pleading with countries to produce more aggressive plans to combat global warming over the coming year.

“The point of no return is no longer over the horizon. It is in sight and hurtling towards us,” he said as the climate talks convened. He said the “world’s largest emitters are not pulling their weight.”

In the end, such promises simply did not emerge.

One question that proved particularly contentious at the talks was carbon trading, an unresolved but crucial aspect of the Paris agreement. Some countries accused Brazil and others of pushing for accounting loopholes that they said would weaken transparency and mask emissions in a way that would undermine the integrity of the accord.

Officials ultimately punted any resolution on the issue, just as they had done a year ago — a result that many negotiators described as a major disappointment.

Scientists have made clear there is no longer time for delay, especially after a decade in which emissions continued to rise.

The U.N. reported last month that global greenhouse gas emissions must begin falling by 7.6 percent each year beginning in 2020 to meet the most ambitious aims of the Paris climate accord. Global emissions are projected to hit a record high in 2019.

The U.N.-led Intergovernmental Panel on Climate Change this year detailed how warming is already threatening food and water supplies, turning arable land to desert, killing coral reefs and supercharging storms. A federal assessment on Tuesday found that the Arctic might already have crossed a key threshold and could become a contributor to global carbon emissions as huge amounts of permafrost thaw.

One of the few promising developments during the talks came not from Madrid but from Brussels, where European leaders on Friday pledged to eliminate their carbon footprint by 2050. Though the European Union talks revealed divisions of their own — coal-reliant Poland refrained from signing on — they provided a rare example of one of the world’s big emitters taking steps to draw up more ambitious reductions goals.

About 80 countries have committed to setting more ambitious targets in 2020, but most are small and developing nations that account for barely 10 percent of the world’s emissions.

During the talks, officials from many of those small countries spoke with exasperation about the pace and tenor of the proceedings, saying they had been excluded from key negotiations and stonewalled by major-emitting nations. But the most visceral displays of outrage came from young protesters, who held news conferences, chanted and pressed for sit-downs with negotiators.

The teenagers were part of a broader group that has staged climate strikes across the world this year, many of them inspired by 16-year-old Swedish activist Greta Thunberg.

“I am losing all of my trust in the establishment and the people who are leading this world,” said Jonathan Palash-Mizner, 17, one of the American leaders of Extinction Rebellion.

As the negotiations headed toward their drawn-out conclusion, about 300 people assembled in the middle of the convention hall, where one young speaker after another held a megaphone and called for “climate justice.”

Outside, they gathered with others in front of the cavernous facility. “The oceans are rising and so are we!” they chanted.

But a day, a night and another morning later, when negotiators finally gaveled the divisive conference to a close, the protesters were long gone.

All that remained were the now-empty hallways, dead and dying potted trees and signs that people had passed each day as they exited the subway, warning that time was running short.

“Tick tock,” they read. “Tick tock.”