Castro has not been seen in public since falling ill almost two years ago.
He was shown in a video sitting outside laughing and talking with the two men, then standing as he bids Chavez farewell at the end of an hour-long meeting.
Castro, who has not fully recovered from intestinal surgery in 2006, led Cuba for 49 years after taking power in a 1959 revolution.
He was last seen in a video of a January meeting with Luiz Inacio Lula da Silva, the Brazilian president.
Castro writes occasional newspaper columns, but his long absence from public view had led to rumours that his health was failing.
Two Castros and Chavez were reported to have discussed a wide range of topics including a global food crisis and the US presidential election.