He also said Israel should “pack up” and move elsewhere, repeating comments made last year.
Israel has accused Iran of involvement in the capture of the two Israeli soldiers, which sparked the current crisis, claims Iran denies.
Iran has also been accused of supplying Hezbollah with money and arms.
“Israel pushed the button of its own destruction by attacking Lebanon,” Mr Ahmadinejad said while addressing an education conference.
I advise them to pack up and move out of the region before being caught in the fire they have started in Lebanon
He did not give further information but suggested Islamic nations and others could isolate Israel and its supporters, AP news agency reported.
He also repeated last year’s calls for Israel to move out of the Middle East, comments which sparked widespread condemnation.
“I advise them to pack up and move out of the region before being caught in the fire they have started in Lebanon,” he said.
Iran helped found the Lebanese-based Hezbollah in 1982, but says it only gives spiritual and political support to the group, not financial aid, training or weapons.
It has also rejected Israeli claims it was involved in the capture by Hezbollah of two Israeli soldiers two weeks ago, which led to the Israeli strikes on Lebanon.