DUBAI—A few days before a U.S. drone killed Quds Force commander Qassem Soleimani, the chief of the Iranian navy flew to inspect the first-ever joint naval exercises that the Islamic Republic conducted with the U.S.’s global rivals: Russia and China.

“Today, the era of American free action in the region is over, and they must leave the region,”...