Former President Barack Obama stopped by his hometown on Tuesday to praise dozens of mayors from around the world who convened to sign the “Chicago Charter,” a local-level climate change pledge aimed at replacing regulations rescinded by the Trump administration.

“We’re in an unusual time, where the United States is now the only nation on Earth that does not belong to the Paris Agreement,” Obama said of his administration’s landmark pact, which President Donald Trump pulled out of soon after taking office.

“And that’s a difficult position to defend. . . . Sheltering future generations from the ravages of climate change should be something of an obsession for us.”

Obama spoke to a packed ballroom at the downtown Sheraton Grand hotel to close out the second day of the North American Climate Summit hosted by Mayor Rahm Emanuel, who earlier in the day issued a “clarion call” for leaders from cities across the globe to tackle global warming.

Emanuel, who was Obama’s first chief of staff, was among mayors from 51 cities across 10 nations — and representing more than 60 million residents — who signed the charter, pledging to follow through on actions to reduce greenhouse gas emissions by 2025.

Without mentioning Trump by name, Obama pressed on the importance of “keeping our word on the world stage.”

“And cities, states, businesses, universities and nonprofits have emerged as the new faces of American leadership on climate change.”

He cited this past summer’s “conveyor belt of some of the strongest hurricanes on record” as the type of consequence that made climate change a “priority” during his time in office.

“It’s not because I didn’t have other things to do. . . . It was a very practical understanding based on the science that if we did not get this issue right, then just about every issue was going to be adversely affected.”

Obama got his biggest laugh while touting the benefits reaped by his administration from investing in green energy.

“We saw the longest streak of job creation in American history by far — a streak that still continues, by the way. Thanks, Obama.”

The 44th president went on to lament “the splintering of our media,” which he said makes it “possible to only occupy a world in which the facts that come in conform to your pre-existing conceptions.

“And that’s a challenge particularly for democracy, because democracy is premised on the idea that we can disagree, but there is an objective reality out there. There are certain facts that are not subject to opinion and debate,” he said. “And we may disagree on how we can solve a problem, but at least we can agree that there is a problem.”

Former President Barack Obama, left, shares a laugh after an introduction from Mayor Rahm Emanuel. | Charles Rex Arbogast/Associated Press

Obama said he and Emanuel spoke Tuesday about climate change as a “generational issue.”

“We’re both getting to the age, although we like to think we’re still fit, where you become aware of your mortality. And the thing you want to make sure of . . . is your kids, and their kids, are going to be OK. And the one thing that might make it not OK for them is this.

“We can’t protect our children or our grandkids from heartbreak or mistakes or the vicissitudes of life. . . . But this, this is something we can do something about,” Obama said.

RELATED:
Obama Foundation delays filing plans for presidential center
Feds launch review of Obama Presidential Center impact on Jackson Park
Obama checks in at Daley Center, isn’t picked for jury duty

Earlier in the day, Emanuel was more direct in blasting the White House, which he said remains in denial about the issue of climate change.

“They are entitled to their own opinions. They’re just not entitled to their own facts,” Emanuel said. “The actions we take in the next two or three years will determine the future in the next 20 years.”

Emanuel extolled Chicago’s achievements, noting that all of the city’s public buildings are set to be powered by renewable energy by 2025.

“This is a moment of truth for all of us, especially leaders at the local level,” he said.

The two-day conference had opened Monday with a roundtable discussion by Emanuel and his fellow mayors, moderated by New York Times columnist Thomas Friedman.

“There are only two people who do not believe in climate change,” Emanuel said. “One is at 1600 Pennsylvania Avenue, and the other one is at the EPA.”

Contributing: Stefano Esposito, Fran Spielman, Lynn Sweet