The Venezuelan government said that President Hugo Chavez, who takes every opportunity to rail against the West, and even sometimes puts his gripes into song, helped to free the US hikers in Iran.

The two Americans, Josh Fattal and Shane Bauer, had been arrested with Sarah Shourd, on the Iranian border. The three said that they were hiking in Kurdistan, in Iraq, and were waved over by a soldier who then arrested them. The soldier, it turned out, was Iranian, and they'd crossed into his territory.

The two men were convicted of espionage and sentenced to eight years in prison. They were released this week after putting up a $1 million bail — $500,000 for each of them. Their companion, Sarah Shourd, had been released a year earlier on the same conditions.

Their release coincided with the United Nations' General Assembly, which opened this week. Word that they would be released came moments before U.S. President Barack Obama spoke at the meeting. Iran tends to be theatrical about these diplomatic tension points.

According to this account, Temir Porras, Venezuela's deputy foreign minister said that Chavez raised the issue with the Iranian president. Chavez and Mahmoud Ahmadinejad have had close ties, united in part by their hatred of the West, and the United States in particular.

"He talks regularly with President Ahmadinejad. On the occasions he could, he requested it as a humanitarian, brotherly gesture," Porras said.

"They [Fattal and Bauer] were in an unfortunate situation, wrapped up in geopolitical tensions that went beyond them."

Iranian media confirmed that Iraq, Oman and Venezuela had all put in a good word for the hikers. The pair was flown out of Iran into Oman after their release.

But Iraq and Oman have established relationships with the U.S., while Chavez and the Americans are notoriously cool to one another.

So what's Venezuela's motive? For Chavez, it seemed to be part of his efforts to reach out to American citizens, despite their government's dislike for the charismatic leader. He's donated heating oil to poor American families, for example. Plus, it's a chance for him to take the high road. Here's Porras again, drawing the contrast between the U.S. and Venezuela:

"It shows a respectful, diplomatic, discreet move can have positive results for U.S. citizens. That was not necessarily the attitude of the State Department and U.S. authorities who demand and pressure in a rather arrogant way," he said.

The U.S., for its part, said it was glad to have the trio back home. It had no comment on the diplomatic negotiations though.

Chavez probably shouldn't expect a thank-you note.