Iranian president Mahmoud Ahmadinejad denounced capitalism on Thursday during a speech at Cuba's University of Havana.

"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."

"The capitalist system might do damage, sabotage," he added in a veiled reference to a bomb attack that left a nuclear scientist dead in Tehran on Wednesday.

Iran's economy is a mixture of central planning, state ownership of oil and other large enterprises, village agriculture, and small-scale private trading and service ventures

The Iranian leader spoke warmly of the relationship between Tehran and Havana saying it was based on "solidarity between two revolutionary peoples."

Iran's revolution ushered in a theocratic Islamic government, while Communist Cuba under Fidel Castro was officially atheist for decades.

During the trip, Ahmadinejad held a private meeting later with President Raul Castro, and later with Fidel Castro who he described as "safe and sane."

Ahmadinejad is on the third leg of a Latin American tour aimed at highlighting friendships with countries at odds with the United States.

Ahmadinejad spent less than 24 hours in Cuba before flying to Ecuador on the last leg at his trip, which is economically vital to Tehran as a means of undermining Western sanctions targeting its nuclear program..

"Here I want to declare very clearly that from now on, Latin America will no longer be the backyard of the United States," Ahmadinejad told reporters in Quito on Thursday. "The Latin American peoples possess a culture, a civilization, dignity and a good future."

"Why are the Iranian, Cuban and Latin American people punished by the United States? Have we attacked them in some way? Have we asked for more than we are owed? Never, not once. We have only ever wanted justice," he claimed.

Ahmadinejad declined to answer reporter's questions about Wednesday's bombing in Tehran, saying instead, "The nuclear question is a political excuse. They know that Iran is not looking to make atomic bombs. Iran is not as imprudent as they are."

Ahmadinejad said. "We do not believe in making atomic bombs. We believe that goes against human morality," he said.

The International Atomic Energy Agency maintains Tehran has sought nuclear technology that has solely military applications and is continuing to do so. 

Intelligence sources in Israel, the United States, Europe, and Gulf Arab states have also accused Iran of seeking nuclear arms.

Iran, which refuses to allow international inspectors entry to its nuclear sites under the Nuclear Non-Proliferation Treaty, to which Tehran is a signatory, has referred to Israel as "a one bomb state."