“Thinking well is wise; planning well, wiser; doing well is the wisest and best of all,” says an Iranian proverb. For decades the United States and Iran largely haven’t thought, planned or done well by each other.

One deed in 1953 left a scarring legacy that has brought the two countries to the brink of war today: the coup d’état, orchestrated by U.S. and British intelligence agencies, that overthrew Iran’s democratically elected Prime Minister Mohammed Mosaddegh (also spelled Mosaddeq) and restored power to the shah, Mohammed Reza Pahlavi.

The reformist premier had nationalized the British oil industry in Iran, the Anglo-Iranian Oil Company, created by Winston Churchill to fuel the British fleet when it switched from coal to oil. The shah had tried and failed to dismiss Mosaddegh and, after riots broke out, he fled the country.

The Churchill government enlisted the Eisenhower administration’s support for Mosaddegh’s ouster. Britain was motivated by its desire to regain control over the oil industry in Iran. Arguably, the United States was motivated more by the fear that Mosaddegh wouldn’t be able to stop the spread of communism in Iran than it was by the U.S. share of Iranian oil production after the coup.

“For many Iranians, the coup demonstrated the duplicity by the United States, which presented itself as a defender of freedom but did not hesitate to use underhanded methods to overthrow a democratically elected government to suit its own economic and strategic interests,” the Agence-France Presse reported.

The United States supported the shah — who many considered to be an imposed ruler — for a quarter of a century then abandoned him. His government was known for its autocracy, its focus on modernization and Westernization, and for its disregard for religious and democratic measures in Iran’s constitution.

On my first trip to Tehran, in December 1976, it was apparent that many Iranians — from liberal students to unskilled laborers — had reached a breaking point with the political corruption and the political oppression by the secret police (SAVAK) — preceded by the shah’s security forces, trained in 1953 by Maj. Gen. Norman Schwarzkopf Sr., the father of Gen. Norman Schwarzkopf Jr., who commanded coalition forces during the Gulf War.

The oil boom of the 1970s — from which the shah’s family was the foremost beneficiary — had produced accelerating inflation and an expanding gap between the rich and the poor. The government’s attempts to rein in inflation disproportionately affected the thousands of poor and unskilled men who flocked to Tehran and other cities to work in construction. Culturally and religiously conservative, many went on to form the core of the revolution’s demonstrators and “martyrs.”

In Tehran, on my first trip, I saw a few cars stuck in the open drains along street edges known as jubes. A friend there told me the cars belonged to “foreign workers who are unpopular, and get pushed into the jubes, too.”

Just a year later, Jimmy Carter, who visited Iran on New Year’s Eve, toasted the shah, “Iran, because of the great leadership of the Shah, is an island of stability in one of the more troubled areas of the world. This is a great tribute to you, your Majesty, and to your leadership, and to the respect and the admiration and love which your people give to you.”

Iranians wouldn’t swallow Carter’s toast, which was so out of touch with what was going on in the country. Within days, they began the demonstrations that would end the shah’s rule.

James Schlesinger, who served as energy secretary in the Carter administration, told my husband Llewellyn King and me that he had strongly advised the president to tell the shah that if he wanted to hold on to his country, he should pay his army, not his air force. On Jan. 16, 1979, the shah piloted his “Shah’s Falcon” Boeing 727 jetliner from Tehran to Egypt for an extended “vacation,” setting the stage for his country’s Islamic Revolution a month later.

“When the Shah finally fell in 1979, memories of the U.S. intervention in 1953, which made possible the monarch’s subsequent, and increasingly unpopular, 25-year reign, intensified the anti-American character of the revolution in the minds of many Iranians,” Mark Gasiorowski and Malcolm Byrne wrote in their authoritative book “Mohammad Mosaddeq and the 1953 Coup in Iran.”

The 1953 coup’s legacy bore on later events, including the 1979-81 hostage crisis at the American Embassy in Tehran; the United States designating Iran a state sponsor of terrorism in 1984, unleashing severe sanctions; to Secretary of State Madeleine Albright’s speech in 2000, acknowledging the U.S. role in the Mosaddegh’s overthrow and “shortsighted” foreign policy in the region; and Iran’s nuclear enrichment program.

Whether President Donald Trump knows about the coup or not, it was involved in the airstrike that he ordered in Iraq on Jan. 3, killing Maj. Gen. Qasem Soleimani, the commander of Iran’s Quds Force, a specialized unit in the Revolutionary Guards.