WASHINGTON — President Trump gazed out at the cheering men and women — steelworkers in orange, yellow and white hard hats — and declared his solidarity.

“I look at the faces of you people. I could be one of you,” he told them.

That unlikely message weeks ago at a newly reopened steel plant in Granite City, Ill., a town outside St. Louis that has long struggled with declining industrial activity, is one that Trump has cultivated since his presidential campaign. That populist appeal helped him carve out support from rank-and-file union members who felt ignored or insulted by Hillary Clinton and other traditional Democratic allies.

Now Trump seems close to fulfilling one of his biggest campaign promises to labor voters, a deal revamping the North American Free Trade Agreement with Canada and Mexico. Few issues have galvanized organized labor as much as its antipathy toward NAFTA, and Trump’s frequent denunciations of the quarter-century-old pact, along with his attacks on China trade and promises of protectionism, have found resonance especially among white working-class men.

Despite his hard-hat rallies and other intermittent attempts to woo unions, however, Trump has had little success in loosening Democrats’ grip on organized labor, according to polling data and interviews with people who follow the movement closely.

Although he could still make inroads, Trump’s apparent failure so far has contributed to his overall unpopularity and to his party’s risk of losing its congressional majorities in the November midterm election.

As a candidate in 2016, Trump eked out wins in such traditional labor strong-holds as Michigan, Pennsylvania and Wisconsin, which proved crucial for his victory. But he’s gained no ground since, and his party is on the defensive there and elsewhere.

Polls indicate Trump’s approval rating with union households has not changed significantly since his election and stands about where it is with the general population — generally low.

An August survey by Pew Research Center showed that just 40% of union households approved of Trump’s job performance, identical to his support in non-union households; 58% disapproved. Gallup and other nonpartisan polls have found similar results.

Nonetheless, labor leaders have tried to show an openness to Trump, recognizing that in some unions — those for industrial and construction workers, for example — the president has greater support from the rank and file, boosted in part by strong economic growth and solid employment gains.

Trump has invited union leaders into the White House and keeps in regular contact with 230 local, national and international union representatives, said Justin Clark, director of the president’s office of public liaison.

“This is probably the most engaged Republican administration with labor in the last 50 years,” Clark said. He described the message to union leaders as, “We’re not going to agree with everything, but we are going to key you in the minute we know information, with good news or bad news.”

Clark cites several policies as pro-labor, including on trade and cutting regulations to expedite public works projects, while conceding that unions have been frustrated with aspects of the administration’s agenda.

Indeed, union leaders and their allies in progressive groups have been keeping a scorecard and, after a year and a half, it shows that the bulk of the president’s policies have been detrimental to workers. Those include tax cuts that benefit the wealthy, reversals of Obama-era rules favoring the right to organize, a Supreme Court appointee — Neil M. Gorsuch — who cast the decisive vote for a ruling that undermined public-sector unions, and a recent pay freeze for federal employees.

Trump “in every way has run an anti-worker administration,” said Rich Yeselson, a longtime writer and researcher in the labor movement.

Richard Trumka, president of the AFL-CIO, labor’s umbrella organization, has gone to the White House several times and served on the president’s jobs council. He resigned last year, along with corporate representatives on the council, after Trump failed to forcefully denounce white nationalists who rallied violently in Charlottesville, Va.

“When he was elected, I said I would call balls and strikes,” Trumka said in a Fox News interview just before Labor Day. “When he did something that was good for workers, we’d support him. When he did something that was bad for workers, we would oppose him.”

“Unfortunately, to date the things that he’s done to hurt workers outpace what he’s done to help workers,” Trumka said.

As examples, he said Trump had broken a campaign promise to spend $1 trillion on job-creating infrastructure projects, killed a rule on overtime pay and regulations for workers’ health and safety, and allowed lax enforcement of other job safety rules.

Trump, in his characteristic style, snapped back on Twitter, and did so on Labor Day.

Trumka “represented his union poorly on television this weekend,” Trump wrote. “Some of the things he said were so against the working men and women of our country, and the success of the U.S. itself, that it is easy to see why unions are doing so poorly. A Dem!”

For a wealthy Republican who played hardball with unions at his casino-hotels in Atlantic City and Las Vegas, Trump has fared remarkably well with organized labor.

That in part reflects the movement’s declining clout — fewer than 11% of all workers are union members, down from 20% in 1983. But Trump also has exploited long-standing cultural and policy divisions — on immigration and gun rights, notably — to win support from older, more conservative and mostly white workers, especially in the building trades, steel and mining industries, and law enforcement.

The bulk of the labor movement, however, is now made up of government and service-sector workers. They are much more diverse and include many Latino workers, who have felt targeted by Trump’s anti- immigration and racially charged rhetoric. Public employees, who account for almost half of all 14.8 million union members, have been angered over his attacks on their pay and organizing rights.

“We have this notion in our mind of hard-hatted, stereotypically white male union members, and they still exist, but in dramatically declining numbers,” said Jake Rosenfeld, a sociology professor at Washington University in St. Louis who chronicled the diminishing clout of organized labor in his book, “What Unions No Longer Do.”

“He speaks to a labor force that is half a century gone in many ways,” Rosenfeld said.