Visiting the Spanish squad at their training base outside Madrid, Rajoy said the joy the world champions would give the nation by retaining their Euro title would be "very comforting".
"I hope you win because as Spaniards we need a lift in such difficult times," Rajoy said.
"A triumph for the national team would be a morale boost for the whole of Spain," he added before being presented with a team shirt with "M. Rajoy" printed above the number 10 by coach Vicente del Bosque.
Spain play their final warm-up game on Sunday against China in Seville. The team's opening Group C match against Italy in Gdansk, Poland is on June 10.
They are bidding to become the first nation to win two straight European titles with a World Cup in between.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.