Outside her Bel-Air home, Nancy Reagan stood arm in arm with John McCain and offered a significant — but less than exuberant — endorsement.

“Ronnie and I always waited until everything was decided, and then we endorsed,” the Republican matriarch said in March. “Well, obviously this is the nominee of the party.” They were the only words she would speak during the five-minute photo op.

In a written statement, she described McCain as “a good friend for over 30 years.” But that friendship was strained in the late 1970s by McCain’s decision to divorce his first wife, Carol, who was particularly close to the Reagans, and within weeks marry Cindy Hensley, the young heiress to a lucrative Arizona beer distributorship.

The Reagans rushed to help Carol, finding her a new home in Southern California with the family of Reagan aide Edwin Meese III and a series of political and White House jobs to ease her through that difficult time.

McCain, who is about to become the GOP nominee, has made several statements about how he divorced Carol and married Hensley that conflict with the public record.

In his 2002 memoir, “Worth the Fighting For,” McCain wrote that he had separated from Carol before he began dating Hensley.

“I spent as much time with Cindy in Washington and Arizona as our jobs would allow,” McCain wrote. “I was separated from Carol, but our divorce would not become final until February of 1980.”

An examination of court documents tells a different story. McCain did not sue his wife for divorce until Feb. 19, 1980, and he wrote in his court petition that he and his wife had “cohabited” until Jan. 7 of that year — or for the first nine months of his relationship with Hensley.

Although McCain suggested in his autobiography that months passed between his divorce and remarriage, the divorce was granted April 2, 1980, and he wed Hensley in a private ceremony five weeks later. McCain obtained an Arizona marriage license on March 6, 1980, while still legally married to his first wife.

Until McCain filed for divorce, the Reagans and their inner circle assumed he was happily married, and they were stunned to learn otherwise, according to several close aides.

“Everybody was upset with him,” recalled Nancy Reynolds, a top aide to the former president who introduced him to McCain.

By contrast, some of McCain’s friends, including the Senate aide who was at the reception where McCain first met Hensley, believed he was separated at that time.

Albert “Pete” Lakeland, the aide who was with McCain at the reception in Hawaii in April 1979, said of the introduction to Hensley: “It was like he was struck by Cupid’s arrow. He was just enormously smitten.”

As the pair began dating, Lakeland allowed them to spend a weekend together at his summer home in Maryland, he said.

The senator has acknowledged that he behaved badly, and that his swift divorce and remarriage brought a cold shoulder from the Reagans that lasted years.

In a recent interview, McCain said he did not want to revisit the breakup of his marriage. “I have a very good relationship with my first wife,” he said. In his autobiography, he wrote: “My marriage’s collapse was attributable to my own selfishness and immaturity. The blame was entirely mine.”

Tucker Bounds, a McCain campaign spokesman, said: “Of course we will not comment on the breakup of the senator’s first marriage, other than to note that the senator has always taken responsibility for it.”

Carol McCain did not respond to a request for an interview.

About all she has ever said is this to McCain biographer Robert Timberg: “John was turning 40 and wanting to be 25 again.”

After leaving the White House, Carol McCain worked in press relations in the Washington area, retiring about five years ago after working for the National Soft Drink Assn. She now lives in Virginia Beach, Va., and has not remarried. She has two sons from an earlier marriage: Andy, a vice president at Cindy McCain’s beer distributorship, and Doug, a commercial airline pilot.

Carol and John McCain had a daughter, Sidney, who works in the music industry in Canada.

John McCain, who calls himself “a foot soldier in the Reagan revolution,” said in his memoir: “My divorce from Carol, whom the Reagans loved, caused a change in our relationship. Nancy . . . was particularly upset with me and treated me on the few occasions we encountered each other after I came to Congress with a cool correctness that made her displeasure clear.

McCain met Carol Shepp through a mutual friend and fellow midshipman at the Naval Academy, from which McCain graduated in 1958. That friend, Alasdair E. Swanson, married her in 1958. In the early 1960s, the Swansons lived in Pensacola, Fla., where Alasdair Swanson and McCain served as Navy pilots.

But that marriage ended in June 1964 after Carol sued for divorce, alleging that her husband had been unfaithful.

According to McCain, he started seeing Carol shortly afterward. They were married in Philadelphia, her hometown, in July 1965. McCain adopted her two sons, and they had a daughter together. Then in October 1967, McCain’s plane was shot down and he was captured by the North Vietnamese.

She became active in the POW-MIA movement. A former model, she dedicated herself to her children and kept the family together, friends said, while awaiting his return.

“She had the perseverance to carry on,” said Melinda Fitzwater, a cousin of McCain’s who later worked with Carol McCain at the White House. “She had a little baby and small kids. She was a great, unique person.”

On Christmas Eve 1969, while she was driving alone in Philadelphia, Carol McCain’s car skidded and struck a utility pole. Thrown into the snow, she broke both legs, an arm and her pelvis. She was operated on a dozen times, and in the treatment she lost about 5 inches in height.

After John McCain was released in March 1973 and returned to the U.S., he told friends that Carol was not the woman he had married.

Reynolds, working for then-California Gov. Ronald Reagan, said she first met the couple in San Francisco at a reception for ex-prisoners. She later introduced them to the Reagans at their home in Pacific Palisades.

“They were just an attractive couple,” Reynolds said. “The Reagans had great admiration and respect for John.”

In 1974, Reagan invited McCain to speak at a governor’s prayer breakfast in Sacramento. The former prisoner of war told the story of a fellow captive who had scratched a prayer on a cell wall. Ronald and Nancy Reagan were reduced to tears. It was “the most moving speech I had ever heard,” Reynolds said.

In the next few years, family and friends said, there was no sign that McCain was unhappy in his marriage. Fitzwater recalled visiting the family on Thanksgivings, and McCain seemed content barbecuing a turkey on his outdoor grill near Jacksonville, Fla.

Navy officers in the squadron McCain commanded in 1977 said they did not know anything was wrong. “When I went to parties at their home, everything seemed fine,” said Mike Akin, a naval flying instructor. “They seemed to be a happily married couple.”

But two years later, while on a trip as a Navy liaison with the Senate, McCain spied Hensley at the Honolulu reception. In a recent television interview with Jay Leno on the “Tonight Show,” Cindy McCain joked about how the Navy captain had pursued her. “He kind of chased me around . . . the hors d’oeuvre table,” she said. “I was trying to get something to eat and I thought, ‘This guy’s kind of weird.’ I was kind of trying to get away from him.”

John McCain was 42; she was 24. During the next nine months, he would fly to Arizona or she would come to the Washington area, where McCain and Carol had a home.

Carol McCain later told friends, including Reynolds and Fitzwater, that she did not know he was seeing anyone else.

John McCain sued for divorce in Fort Walton Beach, Fla., where his friend and fellow former POW, George E. “Bud” Day, practiced law and could represent him.

In the petition, he stated that the couple had “cohabited as husband and wife” until Jan. 7, 1980.

His wife did not contest the divorce, and Day said that the couple had reached an agreement in advance on support and division of property. By then she was living in La Mesa, in San Diego County, with the family of Meese, a close Reagan aide and future attorney general.

“We knew John and Carol both since he came back from Hanoi in 1973,” Meese said recently. “They have been friends of ours ever since.

“She was with us for maybe four or five months. Their daughter and our daughter were friends, and they went to school together.”

Carol McCain was distraught at being blindsided by her husband’s intention to end their marriage, said her friends in the Reagan circle.