Ronald Reagan campaigning in Iowa in June 1976. (Walter Zeboski/ASSOCIATED PRESS)

Forty years ago, Ronald Reagan and Gerald Ford came to a final showdown at the Republican National Convention in Kansas City, Mo. It was the first time since 1948 that no one knew heading into the convention who the nominee would be.

And it was the last until, most likely, this summer’s GOP convention in Cleveland. Unless Donald Trump wins 392 more delegates in the remaining primaries, Republicans supporting Trump, Ted Cruz and John Kasich will come to a bitter brawl over the nomination and attempts to sway uncommitted and wavering delegates. The outcome is unclear, but this is for sure: It will be the most watched, most controversial convention since 1976, a year that brought the death and eventual rebirth of the Republican Party. In the wake of Watergate, the party was decimated, but Reagan’s rise would soon have it back in power.

Lofty thoughts about the future of the party, though, were not on the minds of Reagan’s or Ford’s aides that summer. They were using everything in their power to win the damned nomination. Operatives jostling on behalf of Trump, Cruz, Kasich and the party establishment this year (in some cases, they’re the same people from 1976) will be wheedling, scheming and shouting their way toward every delegate they can get. Each election is different, but if you want a preview of what to expect, the machinations that led to Ford’s nomination are a good place to start.

Kansas City was sweltering that August, and the Kemper Arena was no exception. The city had spent millions to welcome the Republicans; even its red-light district was festooned with red-white-and-blue bunting, with dancing elephants in the windows of several smut peddlers. But inside the arena, the Republican Party was reeling as it opened the convention.

Ford had been elected only by the citizens of Michigan, who had sent him to Congress; he was elevated to the presidency by the resignations of Vice President Spiro Agnew and later President Richard Nixon. Now he’d need to win a presidential nomination, and after 30 primaries and 11 caucuses, he was narrowly ahead but just short of the 1,130 delegates he needed. When the convention began, Ford had 1,106 delegates to Reagan’s 1,034; 119 were uncommitted.

Both Reagan and Ford had been working to charm those remaining delegates before the gathering. Ford and James A. Baker III, his delegate wrangler, fully understood how the power and majesty of the presidency could be used to recruit support for the incumbent. Like this summer, there were very few restrictions on what candidates could do to try to woo delegates, and Baker was determined to use any legal means.

Edwin Schwenk, the GOP chairman of Suffolk County, N.Y., had a private meeting with Ford and (as Jules Witcover later wrote) “reported afterwards that Ford had agreed to take a closer look at the problems of a Suffolk sewer district facing cuts in federal aid!” The Ford team told uncommitted delegates that they would be asked to state dinners, including one featuring Queen Elizabeth II. Others were invited to sit on the deck of an aircraft carrier, the USS Forrestal, in New York Harbor to watch the bicentennial July 4 fireworks with the president.

The Mississippi delegation and its 30 votes got special attention — particularly its conservative chairman, Clarke Thomas Reed, who had promised to support Reagan but would soon bolt to Ford over a critical rules fight after heavy courting by Ford, his chief of staff, Dick Cheney, and other aides. Five previously uncommitted delegates from Pennsylvania who declared for Reagan reported being “harassed and ostracized” by Ford’s allies in Kansas City. Some Illinois delegates wound up taking lie-detector tests after Ford’s side raised accusations of vote-buying. (The Illinois police officer who administered the test told Reagan aide Don Totten that Totten was the only politician he had ever tested who passed.) When Ford arrived in Kansas City on Aug. 16, he pressed the flesh like a candidate for school board; it was a sign of weakness for the incumbent president, but he needed the votes.

Reagan had assets, too. He enlisted Hollywood’s glitterati to call and dine with delegates for weeks ahead of the convention. Pat Boone, Jimmy Stewart and Efrem Zimbalist Jr. helped charm wavering or uncommitted delegates. Reagan met with state delegations one after another, promising to govern differently than Ford, who was leading a country gripped by hyperinflation, gas lines, disco music, polyester leisure suits and pet rocks.

In the humid convention hall, some 17,000 people — delegates, alternates, reporters, political hacks, White House staffers, hangers-on, vendors, sleep-deprived family members and the candidates themselves — substituted the slow grind of the primaries for sudden flashes over parliamentary procedure and platform language. For instance, Ford’s forces were so worried that wavering delegates would bolt for Reagan that the Republican National Committee passed the “Justice Amendment,” which would lock up 939 delegates for Ford on the first ballot. But the party committee had no jurisdiction over the convention rules; only the gathering’s rules committee did. Several days later, that panel, fueled by Ford loyalists, approved the amendment as well.

The RNC was under the complete control of the Ford campaign, and the tactics it used in Kansas City were “ruthless, cold-blooded and bordering on the fringe of being unethical,” Robert Nakamura wrote in Political Science Quarterly after the convention, quoting an unnamed source. The RNC awarded Ford delegates hotels close to the arena; Reagan delegates were assigned motels as far as 70 miles away, across the state line in Kansas. Pro-Ford delegations such as New York were given prime seats toward the front; pro-Reagan delegations such as Texas were stuck at the back, under a partial overhang from which Ford allies dumped trash on the Reaganites during the convention week, recalled Ernie Angelo, a Reagan aide from the Lone Star State.

Ford’s strategists knew they had to prevent Reagan from addressing the hall before voting began, since he was far better at giving a speech than the incumbent. They were determined to win the nomination on the first ballot, fearing that delegates they’d won during the primaries would succumb to Reagan’s siren song.

Reagan’s campaign manager, John Sears, planned to make a motion on the floor that if a rule known as 16-C passed — it would have forced Ford to name his running mate before the nomination vote — both Ford and Reagan would have to address the convention. Tempers were running high, and Ford’s campaign worked hard to defeat the rule, in part to keep Reagan from speaking.

Ford had already dumped Vice President Nelson Rockefeller from the ticket, but the New York scion was on the floor, directing his supporters to back the president anyway to keep the party from lurching to the right. At one point, Rockefeller ripped a Reagan sign out of the hands of a North Carolina delegate, and a melee ensued on live television. In retaliation, a Utah delegate tore New York’s phone out of its base. The phone was connected to the Ford high command. Rockefeller was later spotted gleefully holding the unattached phone over his head; some Reagan fans saw it as a metaphor for the old liberal being out of touch with his own party. Late in the evening, the Reagan camp’s push for 16-C was narrowly defeated.

In one of the convention’s boldest strokes, Reagan startled the party by announcing in advance that his running mate would be Sen. Richard Schweiker, a liberal Republican from Pennsylvania. (The state had more than 100 delegates, and almost all were uncommitted.) The move dismayed conservatives — but it showed Reagan’s willingness to do what he needed to do to win.

It wasn’t enough. On the first ballot on Wednesday, Aug. 18, the penultimate day of the convention, Ford got 1,187 votes to Reagan’s 1,070. The incumbent president won just 57 votes more than he needed.

By prior agreement between the campaigns, the winner would call upon the loser. So Ford went to the Alameda Hotel to meet in private with Reagan and start mending fences. Beforehand, Reagan sent word that Ford shouldn’t offer the vice-presidential nomination; the defeated candidate didn’t want it, but he also didn’t want to embarrass Ford by saying no. Weeks earlier, when the subject of a Ford-Reagan pairing came up, Ford told his chief of staff, Dick Cheney: “Absolutely not! I don’t want anything to do with that son of a bitch!” as Cheney recalled to me years later. For the first time that year, Ford and Reagan agreed on something.

On Thursday, Aug. 19, Reagan and his wife, Nancy, met one last time with his staff and supporters at the Alameda Hotel. Choking up, he spoke with a husky voice. Nancy Reagan, not wanting the TV cameras to see her tears, turned her back on the audience.

Gary Hoitsma, then a 24-year-old Reagan aide, remembered the room as full of weeping staffers and loyalists. The only one with dry eyes was Reagan, Hoitsma told me: “He assured everyone that he wasn’t going to brood or retire to some rocking chair.”

“Somebody has once described backstage politics as a little bit like looking at civilization with its pants down,” Reagan joked at the Alameda. “No, don’t get cynical, because look at yourselves and what you were willing to do, and recognize that there are millions and millions of Americans out there that want what you want, that want it to be that way, that want it to be a shining city on a hill.”

In November, Ford — his image wounded — lost the presidency to Jimmy Carter of Georgia. Four years later, it was Reagan’s time.

Twitter: @CraigSBPA

Read more from Outlook and follow our updates on Facebook and Twitter.