During the visit Hamon was to meet Costa, whose government is supported from outside by the hard-left Left Bloc, thanks to a pact they signed in late 2015.
"The Portuguese left is a Socialist government supported by a bloc, they have showed that you can get out of austerity and reconcile economic and social progress," Hamon commented on a visit to the French lycée in Lisbon.
The Socialist left-winger, who won a surprise victory in his party's primary in January, said he wants to create "an arc of alliances through which we will be able to reconstruct the European Union".
But he dodged questions on a phone conversation with hard-left candidate Mélenchon, saying he did not want to turn negotiations over uniting the French left before the presidential election into a soap opera.
Mélenchon on Thursday laid out his preconditions for negotiating with the Socialist candidate.
He called on Hamon to break with the legacy of the current government, notably by dropping ministers who forced through its controversial labour law - such as former prime minister Manuel Valls and labour minister Myriam El-Khomri - as candidates in the parliamentary poll that will follow the presidential one.
Mélenchon also called on Hamon to rule out any agreement with former economy minister Emmanuel Macron, who is standing for his own hastily formed party, arguing that he was proposing a "continuation and toughening" of the policies of President François Hollande's government.
Greens back negotiation
There was good news for Hamon on Thursday evening when the 10,000 voters in the primary organised by the Green party EELV backed talks between their chosen candidate, Yannick Jadot, and the other two left candidates.
Sources say that an agreement between Jadot and Hamon could be announced on Monday.
The latest opinion polls give Jadot 1-2 percent in the first round of voting, Mélenchon 9-13 percent and Hamon 14-18 percent.
Macron is neck and neck with mainstream right-winger François Fillon at about 20 percent, meaning one of them is likely to face the far right's Marine Le Pen, who is at 24-26 percent, in the deciding round.