He was not elected. He was an Islamic socialist who nationalized industries (especially oil) as an attack on Western companies who were helping the Persian economy.
he was a socialist, yet, but not an Islamist
The Anglo-Iranian Oil co gave Britain more than 50% of the profits from the oil and refused to give Iran the 50:50 deal ARAMCO gave to Saudi Arabia