Ahmadinejad also held a private meeting with President Raul Castro and was expected to meet with Fidel Castro.
Ahmadinejad spoke at the University of Havana, where he picked up an honorary doctorate.
At the university, the Iranian leader railed against the United States and its allies and said heartless capitalism is the root cause of war.
"Thankfully we are already witnessing that the capitalist system is in decay," Ahmadinejad said. "On various stages it has come to a dead end -- politically, economically and culturally."
"You see that when it lacks logic, they turn to weapons to kill and destroy," he added.
Cuba was his third stop on a Latin American tour meant to show support from four leftist-led nations -- Venezuela, Nicaragua, Cuba, and Ecuador -- as Iran is increasingly isolated by tightening Western economic sanctions.
Cuba and Iran share similar positions in international organizations, with Tehran condemning the half-century U.S. trade embargo against Cuba and Havana recognizing Iran's right to develop nuclear energy for peaceful purposes.
The Iranian leader is to wrap up his tour in Ecuador today.
compiled from agency reports