* Toppled Shah was closest ally of U.S.
* Iran squeezed by U.S. sanctions
* Curbs cannot break Islamic Republic - Rouhani
* Iran, foes wage Middle East proxy wars (Adds Revolutionary Guards)
By Parisa Hafezi
DUBAI, Feb 11 (Reuters) - Hundreds of thousands of Iranians marched and some burned U.S. flags on Monday to mark the 40th anniversary of the triumph of Ayatollah Ruhollah Khomeini, the Shi'ite cleric who toppled the Shah in an Islamic Revolution that rattles the West to this day.
On Feb 11, 1979, Iran's army declared its neutrality, paving the way for the fall of Shah Mohammad Reza Pahlavi, the United States' closest ally in the Middle East.
State TV showed crowds defying cold rainy weather and carrying Iranian flags while shouting "Death to Israel, Death to America," trademark chants of the revolution which ousted the United States' most important ally in the Middle East.
"Much to the dismay of America, the revolution has reached its 40th year," read one banner.
Soldiers, students, clerics and black-clad women holding small children thronged streets across Iran, many carrying portraits of Khomeini, who died in 1989, and Iran's current Supreme Leader Ayatollah Ali Khamenei.
The large turnout in state-sponsored rallies came as Iranians face mounting economic hardships many blame on the country's clerical leaders.
Last year, Iran cracked down on protests over poor living standards that posed the most serious challenge to its clerical leadership since a 2009 uprising over disputed elections.
Prices of basic foodstuffs, particularly meat, have soared since President Donald Trump withdrew Washington from the 2015 nuclear deal last year and reimposed sanctions.
In January, President Hassan Rouhani said Iran was facing its worst economic crisis since the Shah was toppled. But he remained defiant as Iranians recalled the end of a monarch who catered to the rich and unleashed secret police on dissenters.
In a speech at Tehran's Azadi (Freedom) square, Rouhani said U.S. efforts to isolate Iran would fail.
"We will not let America become victorious… Iranian people have and will have some economic difficulties but we will overcome the problems by helping each other," he said.
U.S. AND ISRAELI "DOGS"
Marchers carried cardboard cutouts of dogs. One had the face of Trump and the other the face of Israeli Prime Minister Benjamin Netanyahu.
Yadollah Javani, the Revolutionary Guards' deputy head for political affairs, said Iran would demolish cities in Israel to the ground if the United States attacked the Islamic Republic.
"The United States does not have the courage to shoot a single bullet at us despite all its defensive and military assets," he was quoted as saying by state news agency IRNA.
State TV showed a cartoon of the Shah being thrown into the "dustbin of history", wearing clothes in U.S. colours and holding Iranian newspapers headlined "The Shah has left!"
Khomeini returned from exile in France two weeks after the Shah and his wife flew to Aswan, Egypt. He was greeted by millions of supporters in Tehran. Revolutionaries later began executing supporters of the Shah including four top generals.
Washington and the Arab world have viewed Iran with great suspicion since the Islamic Revolution, fearing Khomeini's radical ideology would inspire militants across the Middle East.
Today, the United States and its Arab allies are trying to counter Tehran's growing influence in the Middle East, where it has proxies in Iraq, Syria, Lebanon and Yemen.
"The world saw when Iran decided to help people of Syria, Iraq, Lebanon, Palestine and Yemen, they achieved victory. The enemies are now confessing to their defeat," said Rouhani.
Some Iranians criticise their leaders for what they say are foreign adventures which squander funds. Iranian leaders say they are protecting national interests.
Tehran was determined to expand its military power despite pressure from hostile states, Rouhani said.
Iran displayed its ballistic missile capabilities during a parade marking the anniversary, including the Zolfaqar, a ground-to-ground missile with a 700 km (435 miles) range and the Qiam, with a range of 800 km, according to Tasnim news agency.
Brigadier General Hossein Salami, the Revolutionary Guards deoputy head, said Tehran would not withdraw forces from the region, dismissing U.S. calls for Iranian clout to be curbed. (Additional reporting by Bozorgmehr Sharafeddin in London and Babak Dehghanpisheh; Writing by Michael Georgy, Editing by Andrew Cawthorne, William Maclean)
Our Standards: The Thomson Reuters Trust Principles.