Hours after a U.S. strike killed Iranian Maj. Gen. Qassem Soleimani, the Trump administration sent an urgent back channel message to Tehran: Don’t escalate.

The encrypted fax was sent via the Swiss Embassy in Iran, one of the few means of direct, confidential communication between the two sides, U.S. officials said.

In the days that followed, the White House and Iranian leaders exchanged further messages, which officials in both countries described as far more measured than the fiery rhetoric traded publicly by politicians.

A week later, and after a retaliatory Iranian missile attack on two military bases hosting American troops that inflicted no casualties, Washington and Tehran seemed to be stepping back from the brink of open hostilities—for now.