The United States used Swiss intermediaries to urge Iran not to retaliate so strongly that it would provoke President Donald Trump, The New York Times reported Saturday.

The Swiss embassy in Tehran has long been used by the US government as a backchannel to communicate with the Iranians, according to The Wall Street Journal.

After receiving the message from the US, Iran responded by striking military bases housing US forces, though leaving no American casualties, and sending a message saying there would be no further retaliation for now.

The Times reported that that message ultimately convinced Trump to stand down.

Visit Business Insider's homepage for more stories.

United States officials used a secret backchannel to communicate with Iran in recent days, sending messages via Swiss intermediaries warning Iran not to retaliate so harshly that it would further provoke President Donald Trump, The New York Times reported Saturday.

The messages came not long after the Trump administration authorized strikes that killed the top Iranian commander Qassem Soleimani, immediately escalating tensions between the US and Iran.

The Wall Street Journal reported earlier Saturday morning that the Trump administration sent an encrypted fax to Iran just hours after killing Soleimani, warning not to escalate.

The message set off several days' worth of communications between the two countries, using Swiss intermediaries. The Swiss embassy in Tehran has been used by the American government to communicate with Iran since the 1979 Iranian Revolution.

"We don't communicate with the Iranians that much, but when we do the Swiss have played a critical role to convey messages and avoid miscalculation," one senior US official told The Journal.

The Times reported that the secret messages sent after Soleimani's killing urged Iran not to escalate tensions to the point where Trump would feel obligated to strike back even harder.

After receiving the message, Iran responded by firing more than a dozen ballistic missiles at two Iraqi military bases housing US forces, though no Americans were killed.

According to The Times, Iran then sent a message back to the US via the Swiss saying there would be no further retaliation for now.

The newspaper reported that that message was forwarded to Washington within five minutes, and convinced Trump to stand down.

It's still unclear whether Iran will seek to retaliate further in the near future.