Ayatollah Ali Khamenei, who has final say on all state matters in Iran and has been the country's top leader since 1989, was reported to be recovering.
The official IRNA news agency said the operation, which was described as "routine," was successful. There were no immediate details on what had prompted the surgery or the underlying medical condition.
Iranian state TV said that Khamenei told the station just ahead of the surgery that there was "no room for concern" and that it was a routine operation. The TV aired a brief footage of Khamenei just ahead of the surgery in which he asked people to pray for him. Khamenei was a close ally of the late Ayatollah Ruhollah Khomenei who led the 1979 Islamic Revolution and was later Iran's supreme leader until his death in 1989.
He thwarted the movement in support of a reformist presidential candidate, Mir Hossein Mousavi, in 2009, and when hundreds of thousands of Iranians rose up around the country marching in the streets, some overtly denouncing him, he stepped forward to crush the protests.
Khamenei has kept Iran on a firmly anti-U.S. path, pushing ahead with its nuclear ambitions despite international pressure and sanctions. At the same time, Iran has sought to extend its influence in the Middle East through its ally Syria and Islamic militant groups despite attempt by U.S.-backed Arab governments to contain Iran.