Now he is willing to strike regional neighbours as well, including a state that always tried to keep open its channels with Tehran.
From Khamenei’s perspective, this decision would have seemed entirely logical.
Qatar hosts the United States’ biggest air base in the Middle East, known as Al-Udeid, which serves as the hub for all US and allied air operations in the region.
This vital military asset is frequently used by Britain’s Royal Air Force as well as the US Air Force.
For Khamenei, Al-Udeid will have been an obvious target for Iran’s retaliation for America’s assault on the nuclear plants.
But escalation can be done in many different ways, and the signs are that this strike on Qatar was carefully calibrated.
Like all the Gulf states, Qatar has sophisticated air defences and breaching them would have required a salvo of scores – even hundreds – of missiles.
Instead, Iran claimed to have fired the “same number of weapons” as the US used against Iran, which in the case of the US strike on the country’s nuclear plants, was 14.
That number of missiles would never have stood much chance against Qatar’s defences – as Iran must have anticipated.
The Qatari authorities duly said there were no casualties in the attack, which suggests that many or possibly all of the incoming missiles were successfully intercepted.
Despite the alarming and unprecedented spectacle of explosions in the sky above Doha, this was probably not an all-out attack by Iran.
Instead, Khamenei – whose forces even seem to have given advance warning to the US – appears to have chosen a calibrated escalation.
He will be hoping that the US interprets that signal correctly and refrains from landing a still heavier blow on Iran than the strike on the nuclear installations on Sunday.
Whether the US will see things in quite the same way depends on the judgment of Donald Trump.