He was 84.
McFarlane, who was in Michigan visiting family, died on Thursday of complications from a prior illness, his family said in a statement.
McFarlane first worked in the White House under Richard Nixon, as a military aide to foreign policy chief Henry Kissinger, after serving two tours in Vietnam as a Marine officer.
Quiet and poker-faced, McFarlane gathered power in Reagan's White House "under a cover of dullness," reporter Robert Timberg wrote. Reagan appointed him national security adviser in 1983 mainly because he was the least controversial choice.
Four years later, televised congressional hearings that revealed McFarlane as a linchpin in the scandal known as Iran-Contra riveted millions of Americans.
McFarlane led arms sales to people he thought were moderates in Tehran on hopes they could free seven U.S. hostages held by Iran-linked Hezbollah in Lebanon. The failed attempts to free them circumvented a U.S. arms embargo to Iran and took place only a few years after Iranian militants had held 52 hostages at the U.S. embassy in Tehran for more than a year.
In the hearings, McFarlane told lawmakers he was unaware that profits from the arms sales were diverted to fund Contra rebels in Nicaragua who were fighting the socialist Sandinista government - until his protégé and fellow Marine, Oliver North, told him so.
But years earlier McFarlane had set in motion ways to fund the Contras, who were fighting the democratically elected Nicaraguan government, without Congress knowing. In the end, the scandal highlighted the ability of White House officials to conduct foreign policy on their own and skirt the Constitution's system of checks and balances meant to keep such policies from spinning out of control.
While McFarlane worked on nuclear weapons control and many other tough issues in Reagan's White House, he feared he would ultimately be remembered for Iran-Contra. He regretted resigning from the White House in the middle of it, yet became ever deeper involved in the scandal after leaving.
VIETNAM TO WHITE HOUSE
Robert Carl McFarlane, son of a Democratic congressman from Texas, was born on July 12, 1937, grew up in Washington and graduated from the U.S. Naval Academy. Between two tours in Vietnam, he earned a master's degree in strategic studies in Geneva.
After returning to Washington and holding several jobs in government, he landed a job the White House. As an aide to Kissinger, McFarlane bore witness to the stinging U.S. defeat in Vietnam. He handled White House communications with the U.S. ambassador to South Vietnam as he led the evacuation of American diplomats by helicopter from the roof of the embassy in Saigon in 1975.
Earlier, Kissinger had helped open relations with China after secret talks, piquing McFarlane's interest in shaping relations with powers on the quiet.
As an aide in the Reagan White House, McFarlane helped launch a study that became known as the Reagan Doctrine, a commitment to roll back Soviet communist influence from Latin America to the Middle East. Soon Reagan appointed him national security adviser. McFarlane took the doctrine to heart.
In Nicaragua, the socialist Sandinista government, McFarlane believed, formed a "beachhead on our own continent ... working from there to spread communism virtually all across our backyard."
Reagan's CIA tried to aid the Contras by bombing an airport and mining ports. But news reports revealed the attacks, prompting Congress to pass the Boland Amendment banning U.S. intelligence agencies from helping Contras.
Nevertheless, Reagan, who saw the Contras as the moral equivalent of the Founding Fathers, told McFarlane to bring him solutions, not problems. Reasoning that the Boland Amendment had no reins on White House officials, McFarlane secretly wrangled funding through other means.
He visited the Saudi ambassador in his mansion overlooking the Potomac River and suggested if the Contras failed, Reagan could lose re-election. Soon the Saudis were feeding $1 million a month to a bank account in the Cayman Islands.
Farther from home, McFarlane feared Moscow would woo neighboring Iran and make inroads to the Middle East. An Israeli contact broached the idea of selling U.S. arms through Israel to moderates in Iran, locked in war with Iraq. Beyond the possibility of freeing the hostages, McFarlane believed building ties to moderates could lead to the eventual overthrow of the Ayatollah Khomeini and a reset of Iran-U.S. relations that could make history.
He brought the idea of freeing hostages to Reagan who was recovering from cancer surgery. To Reagan, who had become obsessed with the plight of the hostages including a CIA station chief, a deal could set them free.
'ASKED TO PLAY GOD'
The Iranians told McFarlane to choose which hostage they would release. "I was being asked to play God," McFarlane said. His choice was easy: William Buckley, the station chief. Washington approved deliveries of missiles from Israel. But Buckley was already dead. While a hostage was released, others were taken.
Feeling he had failed Reagan, McFarlane resigned in late 1985.
Before leaving, however, McFarlane took communication links to the White House's national security council.
In May 1986, McFarlane and Oliver North flew on a mission to Tehran to meet people who they thought would be moderates. Besides a pallet of missile parts, they bore gifts: pistols and a chocolate cake topped with a key, meant to symbolize a diplomatic opening.
They were met not by moderates, but by the Ayatollah's elite military force, the Revolutionary Guards. Days went by. No hostages were released, the Americans went home in defeat.
On the trip back North revealed he had diverted some of the profits from the sales to the Contras. "At least we're using some of the Ayatollah's money in Central America," North told McFarlane.
Another surprise was in store: a story in a Lebanese magazine revealed the disaster to the world. That led to a U.S. investigation that harmed Reagan's reputation and threw McFarlane into depression.
In February 1987, the night before McFarlane was to appear for the second time on Capitol Hill before a commission investigating Iran-Contra, he washed down 30 Valium pills with a glass of wine and went to bed.
The suicide attempt failed.
After pleading guilty to lying to Congress about soliciting funds for paramilitary activities in Nicaragua, McFarlane was sentenced in 1988 to probation, a $20,000 fine and community service.
Unlike other figures in the scandal, McFarlane did not take his constitutional right to evade questions.
In 1992, President George H.W. Bush pardoned McFarlane on the advice of then-Attorney General Bill Barr, who went on to hold the same job under Donald Trump.
STAR WARS As national security adviser, managing the nuclear weapons race with the Soviet Union was a big part of McFarlane's duties. Reagan, who feared nuclear war, wanted to develop Strategic Defense Initiative, or "Star Wars" lasers that could blast nuclear missiles from the sky. Many scientists were skeptical, and some Pentagon officials thought it would worsen the arms race.
Reagan directed McFarlane to convince British Prime Minister Margaret Thatcher to support SDI. McFarlane told her that Reagan believed the system could win British companies $300 million in contracts. "Thatcher sat up and brightened a bit," McFarlane wrote. "At last she looked back at me and said: 'You know there may be something to this after all!'"
McFarlane took pride in helping to achieve the first nuclear weapons nonproliferation agreement with Moscow, but feared Iran-Contra would overshadow it.
He also regretted stepping down in the middle of that crisis. "I shouldn't have done it," he told the Fiasco podcast in 2020 about quitting. "The only person that could have stopped (Iran-Contra) was me."
After leaving politics, McFarlane cofounded a company to develop nuclear power plants abroad using U.S. technology.
Once again, Russia loomed large in his thinking. McFarlane believed if the United States did not offer reactor technology to countries like Saudi Arabia, that Russia or China would. He met with Trump administration officials on the possibilities of bringing the technology to the kingdom, a move critics said could spark a Middle East arms race.
McFarlane is survived by his wife, Jonda, and their three children.
(Reporting by Timothy Gardner in WashingtonEditing by Diane Craft and Matthew Lewis)
By Timothy Gardner