Sixty years ago this month, the United States first sent combat troops into the Middle East. The July 1958 Marine landing in Beirut, Lebanon thus began the era of America’s now seemingly endless wars in the region. The 1958 episode has lessons for today.

Backed up by three carrier battle groups, a Marine Corps battalion in full combat gear stormed a beach near Beirut on July 15, 1958. At its peak there were almost 15,000 Marines and Army troops ashore in Lebanon. At the same time, British paratroopers deployed to Amman, Jordan in a coordinated Western intervention intended to prop up friendly governments in the region.

President Dwight David Eisenhower, who avoided sending troops to fight for his eight years in office, sent them to Beirut because of a coup on July 14 in Baghdad. In the 1950s, Iraq was the West’s strongest ally in the Arab world. Ruled by the Hashemite royal family and united in a loose federation with Jordan, Iraq was the only Arab country to join the so called Baghdad Pact that Eisenhower envisioned as the Middle East version of NATO containing the Soviet Union.

America’s great opponent in the region was Egypt’s charismatic President Gamal Abdel Nasser. Demonized by Israel, France, and England, Nasser was seen by many as a stalking horse for the Soviets. Early in 1958, Egypt and Syria united to form the United Arab Republic which Arab nationalists hoped would lead to the unification of the Arabs from “the Ocean to the Gulf.” Nasser would be its ruler. Crowds chanted his name rhythmically around the Arab world.

Lebanon’s Maronite Christian President Camille Chamun was a fierce enemy of Nasser. He was facing a rebellion by the country’s Muslim population and many Christians who were sympathetic to Nasser. Chamun was trying to get a second term as president, which was unconstitutional and deeply unpopular. Chamun blamed his troubles on Nasser and alleged the United Arab Republic was smuggling arms to the rebels. United Nations inspectors did not support Chamun’s allegations.

The coup in Iraq came as a complete surprise to the American and British intelligence communities. It was also violent: The Iraqi army brutally executed King Faisal and the crown prince, as well as the prime minister. Baghdad was in turmoil. The coup makers were unknown but immediately expressed support for Nasser.

Washington panicked. The usually unflappable Eisenhower convened a National Security Council emergency meeting on July 14. Director of Central Intelligence Allen Dulles estimated that the coup would lead to a wave of pro-Egyptian regime change across the Arab world. Lebanon and Jordan would collapse. Vice President Richard Nixon suggested intervening in Baghdad. Eisenhower later said in his memoirs that “we feared the worst…the complete elimination of Western influence in the Middle East.” He ordered the Marines to assault the beach in Beirut the next day to save the Chamun government and the British sent paratroopers to back up King Hussein in Jordan.

The landing was almost comic. The Marines expected D-Day. Instead they encountered Lebanese girls and tourists in bikinis and boys selling soft drinks and cigarettes. But it was deadly serious. The Marines were ready to enter the capital and suppress the rebels. Nuclear weapons were prepared in Germany for deployment to the beachhead.

Fortunately, the American ambassador disobeyed his instructions and brokered a deal with the Lebanese army to “escort” the Marines, and with the Muslims not to shoot them. A tense stand-off ensued. The Lebanese treated the Marines as guests, not occupiers.

Within days it became apparent the coup in Baghdad was not controlled by Nasser. Instead, the new Iraqi regime became something of a rival to Egypt as the spearhead of Arab nationalism.

Eisenhower sent a senior diplomat to Beirut, who eased Chamun out of office and replaced him with the army commander. The conflict was defused as the Muslims felt vindicated. The Marines came home. The crisis passed. Eisenhower reverted to his customary cautious approach.

The intervention was strongly criticized in the Congress. Senator John F. Kennedy said the administration was demonizing Nasser, who was not a Soviet puppet and should work with Arab nationalism. He predicted the remaining monarchies in Arabia would be swept away if they did not reform. His colleague William Fulbright was against the intervention in Beirut and argued against it on the 14th in the White House.

Only one Marine died in combat in Beirut in 1958. A quarter-century later, we were not so lucky when another intervention in Beirut went horribly wrong. Today, Americans are engaged in combat across the Middle East in Syria, Iraq, Yemen, and elsewhere.

A familiar pattern has emerged. First comes shock and surprise at an unexpected event like the Baghdad coup. Then a rush to judgement that the worst is inevitable. Demonize the enemy. The sky is falling. We must do something. Send in the Marines.

In Beirut in 1958, Eisenhower was lucky, one ambush could have brought escalating violence. He was also smart to adjust to the new realities in the region quickly.