Spanish Prime Minister Mariano Rajoy said Monday that Greece still has time to reach an agreement with its bailout creditors before its existing aid programme ends on Tuesday night.
Greece blindsided creditors on Saturday by calling a referendum for July 5 on the latest bailout proposal being offered to Greece, a move interpreted by its creditors as Athens' desire to break off negotiations.
"Greece has the right to organise all the referenda that it wants but what we are all saying, unanimously, is that until Tuesday night she can still negotiate," Rajoy told a news conference before a meeting with former French president Nicolas Sarkozy.
"The Spanish government will try to find a happy outcome because the opposite will be very bad," he added.
"But Greece must bring something to the table and know that besides demanding European solidarity she must meet her obligations like other nations which received a bailout.
"We can't have a Eurogroup of 19 nations where 18 respect the rules and there is one who we must issue 30-year loans without it respecting its obligations," the prime minister added.
If no deal is reached, Greece looks likely to default on an IMF debt payment of about 1.5 billion euros ($1.7 billion) due on Tuesday, risking an exit from the eurozone.
"There is still time, Greece's second programme expires on Tuesday night, which means we still have 48 hours and I think negotiations can still take place," Spanish Economy Minister Luis de Guindos told public radio RNE earlier on Monday.
"I don't exclude that there could be an agreement between now and this deadline, that is at midnight on Tuesday," he added.
Late on Sunday Greece announced capital controls to prevent banks from collapsing, which have left many Greek depositors scrambling for cash.
The prospect that Greece could leave the eurozone has caused stock markets to drop around the world and caused borrowing costs for other southern European nations like Spain and Italy to rise.
De Guindos brushed off suggestions that a Greek exit from the eurozone could harm Spain's economy.
He said economic contagion was much less likely to happen now than in 2012, when many feared a Greek economic implosion could destabilise Spain financially, due to reforms made by his conservative government.
The minister cited measures that propped up Spanish banks which had been saddled with bad loans after a property bubble burst in 2008 and a lower public deficit as examples.
"The situation of our banks has nothing to do with what it was three years ago, the same goes for our fiscal deficit," he said, before adding that "Spain is well prepared."
De Guindos said his government may raise its forecast for economic growth, which currently stands at 2.9 percent for 2015 and 2016.
The Bank of Spain is more optimistic, predicting growth of 3.1 percent for this year and 2.7 percent for 2016.