The magic number needed to capture the Republican presidential nomination in 1976 was 1,130 delegates, and Ronald Reagan was oh so close as the national convention prepared to convene.

After losing six straight primaries to President Gerald Ford early in the year, Reagan had come roaring back, attacking Ford for his weak foreign policy and deficit spending and winning the crucial North Carolina primary with help from Sen. Jesse Helms. Reagan achieved a political resurrection and posed the most serious challenge to an incumbent Republican president since 1912 when Theodore Roosevelt had taken on William Howard Taft.

After Reagan won the Texas, Indiana, Georgia and Alabama primaries, a nonplussed GOP establishment that favored Ford struggled to understand the former California governor’s appeal. Conservative author Richard Whalen made it easy for them: Reagan was doing well because he was “unsullied by Watergate, untainted by Vietnam, and uncorrupted by a Washington system that isn’t working.”

However, after failing to carry Ohio although easily winning his home state of California, Reagan realized that the political momentum was shifting back to Ford. Something dramatic had to be done. Breaking a long-held precedent, he announced his running mate before the convention: Sen. Richard Schweiker of Pennsylvania, a moderate conservative with a high rating from the AFL-CIO. Schweiker assured Reagan and his aides that he could pry loose delegates from Pennsylvania and other Northern states.

It was a bold gambit, but it failed. Schweiker persuaded only one Pennsylvania delegate to switch to Reagan. And Schweiker’s moderate pro-labor record gave party boss Clarke Reed an excuse to move the Mississippi delegation across the line to Ford. Also ineffective was a convention roll call vote to force Ford to name his vice president in advance—it was rejected by a vote of 1,180 to 1,069, an indication of things to come.

The first and only ballot was breathtakingly close: Ford, 1,187; Reagan 1,070, with 1,130 (half the number of delegates plus one) needed to nominate. Ford’s margin over Reagan was a slim 117 delegates. A shift of only 59 delegates would have given the nomination to Reagan–with its 30 delegates, Mississippi would have provided half of what was needed.

Anxious to achieve unity, Ford generously invited Reagan to join him on the platform following his acceptance speech. Reagan gave a rapt convention and tens of millions of viewers a taste of what they would have heard if he had been nominated. Without notes or a teleprompter, he speculated how Americans 100 years from now would look back at this time.

Would they say, “Thank God for those people in 1976 who headed off that loss of freedom; who kept us now a hundred years later free; who kept our world from nuclear destruction?” This was this generation’s challenge, Reagan declared. “Whether [the Americans of 2076] have the freedom that we have known up until now will depend on what we do here.”

The following day, in what was mistakenly interpreted as a farewell to national politics, Reagan thanked his campaign advisers and workers, many of whom were weeping. “We lost,” he acknowledged, “but the cause—the cause goes on.” And then he added a few revealing lines from an old English ballad he had memorized in childhood, “I’ll lay me down and bleed awhile; although I am wounded, I am not slain. I shall rise and fight again.”

And so he did, running again four years later and applying the lessons of 1976. He handily won the nomination, defeating a lineup of well-known Republicans led by George H. W. Bush. In the fall, he buried President Jimmy Carter in an electoral landslide that produced a Republican Senate. The man whom some so-called pundits considered to be too old and too conservative to lead the country launched an historic presidency that restored Americans’ faith in themselves and their future, sparked an unprecedented period of economic prosperity from top to bottom, and ended the Cold War, after 40 years, at the bargaining table and not on the battlefield.