Rather than bemoan President Trump’s decision this month to pull out of the Paris Agreement, an accord signed by 195 nations to battle rising temperatures, many Republican and Democratic mayors here said the move had re-energized them. A separate effort by Eric Garcetti, the mayor of Los Angeles, and a group whose members call themselves the Climate Mayors also picked up support here; more than 300 mayors have signed a document to abide by the Paris accord and “intensify efforts to meet each of our cities’ climate goals.”

“There is no question that the federal withdrawal of national leadership is a step backward,” Mr. Garcetti said in an interview. “But before Paris and after the withdrawal from Paris, most of the local action has taken place at the mayoral level.”

But some mayors quietly opted not to embrace the initiative. Many conservative Republicans, represented in Washington by leading climate change deniers like Senator James M. Inhofe of Oklahoma, agree with Mr. Trump on the Paris accord and say it will unfairly hurt American businesses. Mayor Mick Cornett of Oklahoma City, a Republican whose tenure as conference president just ended, said he had not signed on to the climate-protection documents. Mr. Cornett, from an oil-producing state, said he cared about the environment but worked on environmental issues on a local level, case by case.

Climate change “isn’t my issue,” he said. “I’m not a me-too kind of guy.”

Facing off against the federal government on climate change is not new to the mayors’ conference. After President George W. Bush rejected the Kyoto Protocol on climate change, more than 1,000 mayors made a nonbinding pledge to abide by the treaty. They vowed to cut carbon dioxide emissions in their cities 7 percent below 1990 levels by 2012.