A spinning class works out in the open air in Pittsburgh's Mount Washington neighborhood. When coal and steel were king, the view of the city would have been difficult through the smog. (Jeff Swensen/For The Washington Post)

The mayor needed a break, and now he had a cold beer and a shot of whiskey on the table in front of him. His Penguins cap was pulled low. His dress shirt was untucked. Bill Peduto was tired after days of firing off defiant tweets, issuing city proclamations and running to speak at rallies and give interviews to media from around the world — generally fighting back with everything he had after President Trump justified pulling the United States out of the Paris climate-change pact by saying at the White House late last week, “I was elected to represent the citizens of Pittsburgh, not Paris.”

“He was saying, ‘Oh poor Pittsburgh, look at the trouble they’re in,’ ” Peduto said now, sipping his beer. “But that’s not Pittsburgh.”

Peduto, 52, a Democrat, sat inside a small bar called Cappy’s, his eyes locked on a large-screen TV. He, along with just about everyone else in this southwestern Pennsylvanian city, was watching the Pittsburgh Penguins play in the Stanley Cup hockey finals Saturday. He was surrounded by friends. Some had grown up here, like he did, and remembered what the city had once been like, when the steel mills were closing. Others had arrived more recently, as Pittsburgh reinvented itself into a hot spot of technology and medicine, where Uber tests its driverless cars, Google employs hundreds of workers and its hospitals are among the best at organ transplants.

While that one sentence in Trump’s speech might have been just an applause line, a rhetorical flourish quickly forgotten in national political circles, it continues to resonate here. Trump was widely criticized for his nod to Pittsburgh because it’s a solid blue dot in a regional sea of red. Hillary Clinton got 75 percent of the city’s vote in the presidential election. But his comment also revealed a deeper misunderstanding about which regions are flourishing in the new economy and how they got there.

And it’s an argument that could be revisited this week, as Trump is expected to attend Thursday’s opening of a new coal mine about 60 miles east of Pittsburgh, a visit that the president hinted at in last week’s speech. “They asked me if I’d go,” Trump said. “I’m going to try.”

Many people in Pittsburgh, from retirees to steelworkers to students, said they viewed the Paris deal — which calls for countries to meet voluntary goals for reducing emissions — as an opportunity for the city, especially in a place that once was so smoggy that streetlights sometimes were needed during the day in the 1940s. The move to greener technology would mean retrofitting buildings to make them more efficient, providing the raw materials for wind turbines and helping develop driverless taxis, to which the city gave a green light last year.

That’s what got Peduto so mad. Having experienced the rise and fall of the steel industry, Pittsburgh already knew that trying to hold on to its past was futile.

“Time only goes one way,” Peduto said, walking down the street outside the bar during an intermission in the hockey game.

Where the city’s steel mills once stood, there are shopping centers and mixed-use developments. Its last mill closed in 1999.

That property is now home to Uber’s autonomous-driving test track and a fledgling autonomous-car-manufacturing center. Companies working on driverless car technology have pledged to spend $3 billion in Pittsburgh over five years, Peduto said. And those projects would be helped by the Paris deal.

The news that Trump intended to drop out of the Paris pact and his pithy line about Pittsburgh shot across the city.

“You could almost hear the jaws drop across the geographic area,” said Jerry Shuster, a political communications professor at the University of Pittsburgh. “I don’t know what he was trying to do except irritate Pittsburgh.”

“I guess the alliteration was too good to pass up,” said Bill Flanagan of the Allegheny Conference on Community Development.

“He must’ve been talking about Pittsburg, Kansas,” said Tom Papadakos, an attorney.

Leo Gerard, head of United Steelworkers, was in his office on the 12th floor of a downtown building when he heard Trump’s reference. He said that his union — which represents many of the 100,000 American steelworkers — supports the Paris deal. He saw it as a missed opportunity. You need lots of steel to build a wind turbine, he said, disagreeing with Trump’s sentiment.

Peduto was in his office when Trump made his announcement. He turned to the president’s favorite communication medium and started tweeting himself, shooting off a volley of messages. When White House press secretary Sean Spicer shared a quote from the speech, Peduto replied, “As the Mayor of Pittsburgh, I can assure you that we will follow the guidelines of the Paris agreement for our people, our economy & future.”

It was the start of a pattern that would play out in the coming days — mayors and corporate leaders pledging to follow the Paris accord, even if the federal government would not.

Peduto issued a proclamation calling for Pittsburgh to meet ambitious targets for carbon-emission reductions. His small communications staff struggled to keep up with the interview requests pouring in from around the world. He ordered City Hall to be illuminated by green lights at night to show the city’s support for the Paris deal. He stopped by a March for Truth rally downtown over the weekend, telling the crowd: “Pittsburgh is a shining example of what the Paris Agreement is all about.”

Peduto was defiant.

But the world just outside Pittsburgh — in the rural counties that voted for Trump — is different.

“It’s like Alabama or Mississippi, it’s so conservative,” said George Dethlefsen, chief executive of Corsa Coal, which is opening that new coal mine this week in Somerset County, where Trump got 76 percent of the vote.

Trump did make a campaign stop in Pittsburgh last June. He spoke at the Lawrence Convention Center downtown, named for the Pittsburgh mayor credited with leading the campaign that cleaned up the city’s polluted air in the 1940s and ’50s. Trump mentioned his “friend,” Steelers quarterback Ben Roethlisberger. But it was mostly a typical stump speech, with chants of “Build the Wall,” accusations that the Chinese were dumping steel, and calling the media “terrible human beings.” He didn’t talk about global warming or the Paris pact.

Pittsburgh is not the only Pennsylvania city slighted by a Trump characterization. On the campaign trail last year, he described Harrisburg as “a war zone.” That chafed some residents of the relatively prosperous state capital, who speculated that Trump must have gotten the idea from looking out his plane as he landed at the airport and saw an old, unsightly — but still operational — steel mill along the river.

But if Trump or his speechwriters were looking for a major city to use instead of Pittsburgh, it would have been tough. Clinton won 36 of the 39 largest U.S. cities, according to pollsters, crystallizing the rural vs. urban divide that seemed to define the 2016 election.

Pittsburgh, a city of 305,000, is known as Steel City or the City of Bridges. It once was known as the City of Smoke or “Hell With the Lid Off” before the pollution was controlled.

“Do you remember when it smelled like rotten eggs in the air and you had to wipe the black off your car? The rivers were black,” recalled Aldo DeSarro, 66, outside the La Prima Espresso shop in a warehouse district booming with visitors. “It’s a lot better now.”

Pittsburgh is also sometimes called the Paris of the Appalachians, as it has long served as the cultural heart of the mountainous region. Becky O’Connor recalled the nickname. She was leaving an afternoon showing of “An American in Paris,” the Gershwin musical, at the Benedum Center downtown. A registered Republican but not a Trump fan, she said she was unsure about whether pulling out of the Paris deal was the right move. But she was stunned by Trump’s comment about the city.

“It really shows he doesn’t understand Pittsburgh,” she said.

Back at Cappy’s bar, the Penguins scored early in Game 3 and the bar erupted into an elated roar, even though the home team would go on to lose this one.

“Welcome to the Rust Belt, baby!” one of the men sitting with Peduto shouted at the TV screen.

It was a purely Pittsburgh moment — both small town and big city. One of the biggest differences over the years was the type of people sitting with the mayor. Two were attorneys. One was an engineer. One taught at the University of Pittsburgh and led a top-notch physical-rehabilitation program. Another headed up a small life-sciences firm working on a better method for treating wounds.

Outside during a break in Saturday’s game, Peduto recalled how his dad would drive him when he was a young boy to see the city’s fire-breathing smokestacks at night. “It was like ‘The Wizard of Oz,’ ” he said. When he got older in the ’80s, he and many of his friends had to leave town to find work as the steel industry collapsed. But then Pittsburgh stopped trying to hold on to the past. Today, a hospital system is the leading employer. Technology jobs are booming. People are moving back into the city. One small neighborhood, Lawrenceville, is known as Pittsburgh’s Brooklyn for its density of hipsters. The city’s transformation took 30 years, Peduto said. And who knows if it will hold.

“But what’s not going to happen is that our past is going to be the path for our future,” he said.

Then he headed back to the bar. He wanted to catch the end of the game.