Iran is signaling that it will buck U.S. efforts to roll back its military presence in the Middle East, moving to cement foreign alliances and continuing to project power abroad despite sanctions that have helped put intense pressure on its economy.

Tehran signed a long-term security pact with Syria in August, and has kept up the flow of arms and financial support to proxy forces around the region, according to U.S. officials and a person close to Lebanon’s Hezbollah militia.

On...