Mahmoud Ahmadinejad told Islamist militants he was proud of them as he addressed supporters near the Israeli border.
The Iranian president also visited the village of Qana, where an Israeli airstrike in 2006 killed dozens. He visited graves of the victims of the Qana attacks and later laid a wreath at a memorial.
Mr Ahmadinejad spoke to his supporters who were gathered in Qana and praised the Lebanese army for "standing firm against the criminal Zionists."
Earlier in the day, he visited the border town of Bint Jbeil, dubbed "the capital of resistance" because it was a centre for Hezbollah guerrilla action against Israel during the Jewish state's 18-year occupation of southern Lebanon.
The US and Israel have called Ahmadinejad's visit to the border a provocation that undermines Lebanon's sovereignty.
The visit exacerbates fears among many Lebanese, particularly Sunnis and Christians, that Iran and Hezbollah are seeking to impose their will on the country and pull Lebanon into a conflict with Israel.
Ahmadinejad has sought to depict his country as an ally of all Lebanese, not just Hezbollah. But Western-backed parties in the country's coalition government has warned that Ahmadinejad is seeking to transform Lebanon into "an Iranian base on the Mediterranean."