Spain's Finance Minister Luis de Guindos said it lent that sum to Greece in loans including some that formed part of Athens' international bailout from 2010.
The hard-left party Syriza which came to power in Greece last month rejects the terms of the bailout and the international "troika" of bodies that arranged it.
It has been negotiating with EU leaders this week to lighten its debts, but so far no deal has been struck.
"There is a red line. Naturally, Spain wants to and will ensure that its loan is repaid," Guindos told a news conference on Friday.
He said €26 billion "is roughly what we spend in a year on unemployment benefits in this country where the unemployment rate is 23 percent".
Guindos said that Spain had not been heavily exposed to Greece's banking sector, unlike some European countries which were motivated to take part in the bailout for that reason.
"Those €26 billion were in pure solidarity with Greece," he said.
Spain's conservative government has pushed through tough public budget cuts that it said were necessary to rescue the country from the recent economic crisis.
It also received €41 billion from international creditors to protect its financial sector from collapse.
Syriza won last month's elections campaigning against such austerity measures in Greece.
Syriza has an ally in the Spanish protest party Podemos, which is nipping at the heels of the governing Popular Party in the polls ahead of a Spanish general election due in November.