Iranian President Mahmoud Ahmadinejad has ended a visit to Venezuela in which he and his Venezuelan counterpart Hugo Chavez denounced what they call U.S. "imperialism."

The two leaders praised each other Wednesday in Caracas, solidifying their anti-American alliance.  Mr. Ahmadinejad compared Iran and Venezuela to brothers-in-arms engaged in trench warfare against imperialism, a reference to the United States.

Mr. Chavez also denounced U.S. ally Israel as a "murderous arm of the Yankee empire," in his words.  He rebuked Israel's president for predicting Venezuelans and Iranians will make their leaders disappear.  Mr. Chavez said he views Shimon Peres' recent comment as a threat.

The Venezuelan president also said Cuba's ailing former President Fidel Castro had asked him to deliver a "hug" to Mr. Ahmadinejad.  Mr. Chavez said he met briefly with Mr. Castro in Cuba on Tuesday.

Iranian state media say Mr. Ahmadinejad left Venezuela later Wednesday for Senegal, the final stop on his five-nation tour.

Earlier Wednesday, the Iranian and Venezuelan presidents attended the signing of several bilateral agreements, including joint projects in energy, housing and farming.

Mr. Ahmadinejad's visit drew protests from Venezuela's opposition, which accused Mr. Chavez of developing a "dangerous" alliance with Tehran.  Venezuela's Jewish community denounced Mr. Ahmadinejad as an "ominous character" who could do serious harm to humanity.

The Iranian president has described the Holocaust as a myth and called for Israel to be "wiped off the map."

Mr. Ahmadinejad's visit to Venezuela was the last leg of a tour of three Latin American nations that support Iran's controversial nuclear program. He also visited Bolivia and Brazil.

Western nations suspect Iran of trying to develop nuclear weapons and have demanded that it stop sensitive nuclear work.  Iran insists its nuclear program is for peaceful purposes. 

Some information for this report was provided by AP, AFP and Reuters.