Actor Sean Penn played a direct role in the release of two American hikers who were held for 781 days in a 104-square-foot prison cell in Iran.

The hikers had been in Iranian custody since their arrest along the Iraqi border in 2009. They were jailed for espionage and illegal entry, though the pair remained adamant that they were simply hiking.

The question of how the two 29-year-olds and Bauer's fiancée Sarah Shourd (who was released last September) stumbled across the border into Iran during a hike in Iraq remains unanswered. The group was found near the mountainous border between the two countries on July 31, 2009.

Penn flew to Venezuela to persuade President Hugo Chavez to intervene with Iran's leader, a source close to the release process told Reuters, which first broke the story on Friday.

Josh Fattal and Shane Bauer were released on Wednesday, and the details about the efforts to win their freedom slowly trickled out.

Chavez brought the case up with his Iranian ally Mahmoud Ahmadinejad after he was alerted to the Americans' plight by friends in U.S. intellectual circles, Venezuela's deputy foreign minister told Reuters on Thursday.

The source went on say that the American intellectual who took up the case was actually two time Oscar winner Sean Penn.

Penn was very committed to the case ... He flew to Caracas several months ago to raise it with Chavez and he kept on it, Reuters quotes the source as saying. The State Department was reportedly made aware of Chavez's involvement in freeing the hikers and did not try to block it.

The account was confirmed by Penn's spokeswoman in the United States, but no additional details were revealed.

Penn is known for his outspoken activism. He vocally criticized the former Bush administration, and was heavily involved in humanitarian efforts following both Hurricane Katrina and Haiti's earthquake.

Penn has been close with the Venezuelan dictator for some time. In January, Chavez even joked that Washington should appoint Bill Clinton, Oliver Stone, or Sean Penn as its next ambassador to Venezuela.

We have a lot of friends there, Chavez said, noting that his choices would be a great way to end the diplomatic stand-off with Caracas.

Bauer and Fattal returned home on Sunday after the Gulf sultanate of Oman paid a $1 million bail.