TEHRAN, Iran — Hamas' top political leader thanked Iran Monday for its support during Israel's Gaza offensive, calling his movement's most powerful ally a "partner in victory."

Khaled Mashaal received a hero's welcome from hundreds of Iranians at Tehran University, where a crowd chanted: "Hail to the soldier of holy war." On Sunday, he met the country's two top leaders, President Mahmoud Ahmadinejad and supreme leader Ayatollah Ali Khamenei.

Mashaal's visit to Tehran underlined his group's close ties with Iran. But the country's substantial financial backing for the Palestinian militant group could be strained in the coming months, as the Islamic Republic struggles with growing financial troubles exacerbated by the sharp drop in oil prices.

Mashaal's visit was his first since Israel launched its three-week assault in late December, aimed at stopping years of Hamas rocket fire into southern Israel. The fighting killed nearly 1,300 Palestinians, Gaza officials say, along with 13 Israelis.

A cease-fire went into effect two weeks ago but has since been tested by sporadic Palestinian shelling and retaliatory Israeli airstrikes. Hamas has claimed victory simply by surviving.

Israel and the United States accuse Iran of supplying Hamas with weapons, including rockets. Tehran denies it, but says it does support Hamas financially — believed to be to the tune of hundreds of millions of dollars. The funding has been vital for sustaining Hamas under the crippling blockade that Israel and Egypt have imposed on Gaza since Hamas took over the Palestinian territory by force in 2007.

Mashaal, who heads the Hamas leadership-in-exile in Syria, said Iran played a "big role" in helping Hamas with money and moral support during Israel's assault.

"God made us victorious in Gaza, and we, the Hamas movement, came to say thank you to Iran, which stood with us," he said in a speech at Tehran University. "You are our partners in the victory in Gaza," he added, addressing the Iranian people. He the specifically thanked Ahmadinejad and Khamenei.

"Thank you for all the financial, political and popular support which you have given to us. The Palestinian people will not forget."

Israel, along with the U.S. and Europe, considers Hamas a terrorist group. But Iran sees Hamas as justifiable resistance to Israel and the rightful Palestinian government, since 2006 elections that Hamas won.

Iran and Hamas are ideologically different — Iran espouses a fundamentalist Shiite version of Islam, while Hamas adheres to an equally strict rival Sunni version. But the Palestinian militant group gives Tehran a key foothold on the doorstep of Israel and Arab allies of the United States.

Iran has never revealed how much money it provides to Hamas, but the group has said it received hundreds of million dollars from the country over the past year.

That's only a fraction of the billions Iran earns from oil exports, the main source of its foreign income. But the tumble in oil prices — from a record $147 in July to around $40 a barrel now — has slashed Iran's revenues.

The government plans to cut many subsidies to fight a budget deficit of billions of dollars — which could fuel social disenchantment, already high over a domestic inflation rate of about 25 percent annually.

"Iran's generosity could falter when its annual $100 billion oil income falls to $35 billion due to falling oil prices," said Saeed Laylaz, a prominent Iranian political analyst.

But he said Iran was unlikely to cut off the flow of cash completely, because Hamas and Lebanon's Shiite Hezbollah group — another close ally — "are important for Iran's foreign policy toward the U.S."

Iran's presidential elections in June and persistent international pressure over its disputed nuclear program could also force its leaders to focus more on matters at home.

Separate from the government funding to Hamas, Iranians regularly donate money for the Palestinians to the Red Crescent or to charities — some of which may go through Hamas to Gazans. That money too could take a hit because of economic hardships.

At a fundraiser Monday for Palestinian children orphaned during the offensive, housewife Mehraneh Abdi, 43, gave $20. She said she wanted to give more but can't "since the cost of living has increased sharply in the past months in Iran."

Down the street, teacher Minoo Rasai said the government shouldn't be giving so much either, noting that she has not received part of her salary for months.

"The government should pay our salary rather than paying people abroad," she sighed.