TEHRAN, Iran (CNN) -- Hamas leader Khaled Meshaal on Sunday praised Iran for helping Hamas achieve "victory" over Israel in Gaza, according to Iranian media reports.
Hamas leader Khaled Meshaal, right, greets Iranian President Mahmoud Ahmadinejad on Sunday.
"The victory of the people of Gaza was a miracle of God and the Islamic Republic definitely has a share in this victory," Meshaal said after meeting with Iran's Supreme Leader Ayatollah Ali Khamenei, according to Iran's semi-official Fars News Agency.
Meshaal arrived in Tehran for his first visit to the country since Israel's recent military offensive on Gaza, Iranian media reported. He also met with Iranian President Mahmoud Ahmadinejad and Foreign Minister Manouchehr Mottaki.
Meshaal -- who lives in exile in Syria -- is the head of Hamas, which rules the Palestinian territory of Gaza. Hamas has claimed victory over Israeli forces, saying the Jewish state failed to destroy its ability to fire rockets at southern Israel. But Israel has said it achieved its goal in Gaza, which was to change the security situation for southern Israel.
According to Fars News Agency, Khamenei congratulated Meshaal, saying, "The people of Gaza and the Islamic Resistance made us all proud and with their patience and perseverance successfully passed this very difficult test."
The Iranian leader stressed that that the war in Gaza has not yet ended, noting that "the Islamic Resistance must, with full alertness and in proper ways, prepare itself fully for the possibility of the beginning of another war," Fars reported.
Khamenei denounced some Arab countries for criticizing Hamas, and called for Israeli leaders to be tried for war crimes.
Meshaal vowed that the "Palestine government has not, and will not, accept any of the enemy's conditions, including the 2005 agreement regarding the Rafa crossing and the permanent cease-fire."
The Palestinian government is split between Hamas, which controls Gaza, and Fatah, which controls the West Bank. Israel and the United States do not directly negotiate with Hamas, which both countries consider a terrorist organization.
Iran has supported Hamas during and since the 22-day Israeli military operation, which ended more than a week ago after Israeli forces pulled out of Gaza. Tehran held a day of mourning for the Palestinian victims, and protested the Israeli operation.
U.S. and Israeli officials have accused Iran of providing weapons, training and cash to Hamas militants in Gaza.
Israel said its goal was to stop militants in the territory from firing rockets on southern Israel. But Palestinian militants on Sunday fired 10 rockets and mortar shells into Israel -- in violation of the cease-fire -- slightly wounding two Israeli soldiers and one civilian.
Israeli Prime Minister Ehud Olmert promised a "sharp Israeli response" to the ongoing strikes.
Some analysts have said that Israel was sending a message to Hezbollah when it launched its military offensive in Hamas-ruled Gaza. Iran and Syria are key supporters of Hezbollah, which is considered a terrorist organization by Israel and the United States.
CNN's Shirzad Bozorgmehr contributed to this report