Real estate developer Donald J. Trump displays an artist's concept of "Television City," which would be on the far west side of Manhattan, in November 1985. (Marty Lederhandler/AP)

Donald Trump has always looked askance at people whose decisions derive from ideology. He likes to take his stands in the moment, from the gut, even if that means changing his party affiliation seven times in 13 years.

But there’s one issue on which the president has been rock-solid consistent for four decades: his fiery demands that the United States punish countries that take advantage of American workers.

Despite pleas, lessons and arguments from corporate executives, politicians and economists who say trade wars are destructive to American interests, Trump has stood his ground. Starting in the 1980s, he saw the trade issue as a way to build a national reputation as more than a playboy millionaire developer — and a way to connect with struggling American workers despite his life in a gilded Fifth Avenue tower.

The issue spoke to him personally: Driven since childhood by his resentment that others didn’t respect him or take him seriously, he believed his country was similarly being taken advantage of. The idea that Japan, Germany, or in later years, China were boosting their own economies by selling goods in the United States, even as fewer products made the return trip, incensed Trump, according to people who worked closely with him. His country, he believed, was being laughed at and abused. Worst of all, America was losing.

“People think he just came to this issue last year, but he came to it on his own, decades ago, seeing what was going on in the ’70s and ’80s with job losses and manufacturing in decline,” said Dan DiMicco, the former chief executive of Nucor, an American steel company, who advised Trump on trade during the 2016 campaign. “He was a very proud American, and he saw, in his business and around the country, that this trade situation was hurting our workers.”

Through most of the first year of his presidency, Trump peppered his staff with reminders that he had promised voters he would push back hard against countries he contended were sucking jobs out of the United States. Last week, even as some of his top aides continued to warn him that tariffs on foreign goods could damage relations with U.S. allies, Trump made his move.

“I’ve been saying it for 25 years,” the president said Tuesday. “Our country’s been taken advantage of.”

The result, so far, has been the resignation of his top economic adviser, Gary Cohn; unusually open criticism from his own party’s leadership; a decline in stock prices Wednesday; and warnings of retaliation from several nations. Given Trump’s four decades of standing his ground on trade and tariffs, however, there is little reason to expect him to back down.

Beginning in the 1980s, Trump has used the issue — at first, mainly against Japan, which he portrayed as a job-stealing destroyer of the American middle class — to put himself on the map as more than a real estate developer.

“A lot of people are tired of watching other countries ripping off the United States,” he said in 1987. “They laugh at us behind our backs. They laugh at us because of our own stupidity.”

In the 1990s, as he explored running for president, trade was again at the core of his appeal. “The world is ripping off this country,” he said on Larry King’s CNN show in 1999. “You look at what’s happened, Japan, for years, I mean, we’re like a whipping post for Japan. ... Look what Japan does with the cars and the subsidies they get.”

At a time when Japanese interests were buying U.S. film studios and even iconic landmarks such as Rockefeller Center, Trump latched onto an issue with great populist appeal. The nation’s rivalry with Japan had poked its way into the popular culture; for example, Michael Crichton’s best-selling 1992 novel, “Rising Sun,” which later became a movie pitting Sean Connery as an L.A. detective taking on a shadowy network of Japanese businessmen, portrayed Japan as a nation asserting economic hegemony against American business.

“First they take all our money with their consumer goods, then they put it back in buying all of Manhattan,” Trump told Playboy magazine in 1990. “So either way, we lose.”

With Japan as his initial focus, Trump quickly turned the issue into the seed for a political debut that would have a 28-year gestation period.

For Trump, trade was a crucial part of a larger argument about the folly of the United States paying to defend countries that gave back little in return.

“There’s nothing wrong with America’s Foreign Defense Policy that a little backbone can’t cure,” said the headline on a full-page ad that Trump ran in The Washington Post, the New York Times and the Boston Globe in 1987. Trump spent $94,801 on the ads, which won him many times that value in news coverage.

The ad demanded that the United States send Western Europe and Japan a bill to pay for the protection of oil tankers moving through the Persian Gulf — oil that those countries depended on just as much as the United States did.

“The world is laughing at America’s politicians as we protect ships we don’t own, carrying oil we don’t need, destined for allies who won’t help,” the ad said. The Japanese, he said, freed from having to pay for their own defense, “have built a strong and vibrant economy,” and it was “time for us to ... make Japan, and others who can afford it, pay.”

The ad was developed by public relations executives who had been key members of Ronald Reagan’s Tuesday Team, the group that made Reagan’s much-admired TV ads in his 1984 reelection campaign.

“The reason they hired us was to PR the fact that these Reagan boys were working on his ad,” said Tom Messner, one of the executives. “We assumed [Trump] was going to run in ’88.”

The same day the ad ran, Trump let it be known that he would visit New Hampshire to explore a run for the Republican presidential nomination. He drew a big, enthusiastic crowd that cheered as he railed against Japan and Wall Street, saying that when the Japanese “negotiate with us ... they laugh like hell.” Trump quickly decided not to run, but he had seen how effective the issue of trade could be in convincing working-class audiences that the millionaire from Manhattan was on their side.

The trade plaint became a core element of Trump’s speeches to business groups and college commencements. In 1988, at Lehigh University in Pennsylvania, Trump told the story of a Japanese tycoon who visited him at Trump Tower and slammed his fist on Trump’s desk, demanding, “We want real estate!”

Trump warned students that “so many countries are whipping America . . . making billions and stripping the United States of economic dignity. I respect the Japanese, but we have to fight back.”

Trump has consistently argued that U.S. politicians lack the spine to stand up for American jobs. In 1989, he suggested that corporate bigwigs should do the nation’s negotiating with recalcitrant trade partners. He said that as president, he would pick someone like George Steinbrenner, the heavy-handed owner of the New York Yankees, to confront the Japanese and make clear that the United States would “tax the hell out of them.”

Trump’s decision to dive into a controversial political issue wasn’t as much of a stretch as it seemed to some at the time. In the late 1980s, Trump was still building his reputation as a wealthy and successful developer — an image he molded as much through aggressive rhetoric and media exposure as through construction projects. He believed his business would succeed if Americans came to see him as a winner who would never back down.

“I deal with the toughest, smartest people in the world,” Trump told The Washington Post in 1987. “If they think Donald Trump can be walked on, if they think Donald Trump is a rollover, like most people are, the litigation will increase tenfold. It’s very important in life to establish yourself not to be a patsy, and if you don’t, you don’t end up sitting in this chair.”

Even as Japan became a less succulent target for populist politicians, trade remained a key issue driving popular dissatisfaction with Washington politicians of both major parties. Between 1996 and 2004, the Reform Party’s candidates for president — Pat Buchanan, Ross Perot and Ralph Nader — argued that Democrats and Republicans would never address the trade imbalance that they said was devastating American workers.

In the 2000 campaign, when Trump was briefly a candidate for the Reform Party nomination, he announced that if he won, he would appoint himself U.S. Trade Representative and would personally negotiate deals with Japan, which was “ripping us big league”; Germany, which “wants to take over the world economically”; and France, which needed “to be taught respect.”

Trump was being consistent on trade, even as he ranged across the political landscape on so many other issues. In the same Larry King interview in which he launched those attacks, Trump pronounced himself “quite liberal and getting much more liberal on health care and other things. I believe in universal health care,” Trump said. “It’s an entitlement to this country, if we’re going to have a great country.”

As Trump remade himself as a TV reality show celebrity, he would still bring up his resentment of the Japanese. Once, asked why he eschewed handshaking, he said the practice transfers “tremendous germs. ... I wouldn’t mind a little bow. In Japan, they bow. I love it. Only thing I love about Japan.”

Even during the 2016 campaign, after two decades of stagnation in Japan’s economy, Trump would single out the country, listing it with China and Mexico as countries in which “we are getting absolutely crushed on trade.” Japan exports about twice as much to the United States as it imports from this country.

“He has a certain belief system, and that got him into office,” DiMicco said. “Trump knows we’ve been in a trade war with China for 20 years. He knows that after we helped them come back from World War II, Japan and Germany took advantage of us. And he knows that even if the politicians oppose him on this, the people who put him in office have his back.”