Without naming the United States' president, the head of the United Nations sent a message loud and clear to Donald Trump on Tuesday, joining the chorus of international leaders who are not happy with his efforts to erode progress in fighting climate change.

In his first major address on climate change, delivered at New York University, United Nations Secretary-General António Guterres made it clear that whatever the U.S. does—whether it remains in the Paris climate agreement and attempts to backtrack on its own commitments, or whether it exits—the rest of the world will continue to work to reel in the disastrous impacts of climate change before it's too late.

"If any government doubts the global will and need for this accord, that is reason for all others to unite even stronger and stay the course," Guterres said.

The remarks came after Trump's recent trip overseas, which culminated in the G7 summit in Sicily. At the close of the summit, leaders of six of the seven nations—Britain, Canada, France, Germany, Italy and Japan—reaffirmed their "strong commitment to swiftly implement the Paris Agreement" in a communique. The United States abstained.

"The United States of America is in the process of reviewing its policies on climate change and on the Paris Agreement and thus is not in a position to join the consensus on these topics," the communique read.

After the meeting, German Chancellor Angela Merkel told reporters, "The entire discussion about climate was very difficult, if not to say very dissatisfying." She later told a crowd in Germany, "The times in which we can fully count on others are somewhat over, as I have experienced in the past few days."

Within the White House, the question of whether to stay in the Paris climate agreement or leave has been in dispute. Some of Trump's advisors, including EPA administrator Scott Pruitt, have argued that staying in would fly in the face of an "America first" energy policy that they say would promote economic growth. Secretary of State Rex Tillerson has said that America should keep its seat at the table by remaining in the agreement. Energy Secretary Rick Perry has also called for staying in but renegotiating it. Trump, meanwhile, has been marching to a steady beat of climate action rollbacks, and he aims to cut more through the 2018 budget.

On Saturday, Trump tweeted: "I will make my final decision on the Paris Accord next week!" The news organization Axios is reporting that sources close to Trump say he plans to exit the agreement.

In his speech on Tuesday, Guterres seemed at times to be speaking directly to Trump.

"Some may seek to portray the response to climate change as a fundamental threat to the economy," he said. "Yet, what we are witnessing in these early years of a systemic response is the opposite."

Guterres pointed to both the U.S. and China, where new renewable energy jobs are outstripping those created by the oil industry.

"The real danger is not the threat to one's economy that comes from acting," he said. "It is, instead, the risk to one's economy by failing to act."

"The message is simple: The sustainability train has left the station. Get on board or get left behind. Those who fail to bet on the green economy will be living in a grey future. On the other hand, those who embrace green technologies will set the gold standard for economic leadership in the 21st century," he said.

Guterres mentioned next week's Ocean Conference, where representatives of nearly 200 countries will gather at UN headquarters to issue a "call for action" to limit the impacts to marine life from threats related to climate change and other causes.

Earlier on Tuesday, Sweden's deputy prime minister, Isabella Lovin, told Reuters that the United States has been making efforts to weaken that call for action, resisting the use of strong language on climate change.

"I think I can safely say that the United States has not been very keen on strong language on climate change," said Lovin, who will co-chair the conference of almost 200 nations.

The U.S. efforts on oceans and climate echo its move a few weeks ago to weaken language in a consensus statement issued by the Arctic Council. InsideClimate News reported on a leaked draft of the statement that showed six key ways that the United States chipped away at language related to climate change and the Paris agreement.

In the question and answer period following his talk, Guterres was asked how the UN is dealing with the United States.

"It's very simple," Guterres said. "When you disagree with someone, you try to convince that person."

He said the UN is continuing to engage with the Trump administration to stress the importance of remaining in the Paris Agreement, but he added that even if the U.S. government leaves the agreement, it's important for Americans to remain engaged.

"It is very clear that governments are not everything," he said. Likewise, when powerful countries leave a void, he said, others step up to fill it.