BAGHDAD—An attempt by supporters of Iran-backed militias to storm the U.S. Embassy here ended on Wednesday, as protesters withdrew from the area after their leadership ordered the suspension of a violent challenge to American troop presence in Iraq.

The withdrawal was instigated by the Popular Mobilization Forces, an umbrella body for dozens of militia groups including factions aligned with Iran. Some of those groups and their supporters tried Tuesday to force their way into the U.S. Embassy compound but failed to break in....