Real Madrid point guard Sergio Llull sparkled with 15 points for the 2008 silver medallists, who beat the French to win the European Championship in Lithuania last year.
Los Angeles Lakers forward-centre Pau Gasol weighed in with 11 points, while guards Jose Manuel Calderon of the Toronto Raptors and Rudy Fernandez, who has just sealed a move to Real from the Denver Nuggets, each scored 10.
France's San Antonio Spurs guard Tony Parker, who injured his eye last month in a Manhattan nightclub fracas, had a quiet night, playing just over six minutes and scoring two points.
Spain have been drawn in Group B for the Olympics along with hosts Britain, whom they beat 78-74 in a friendly in Valladolid on Monday, Australia, Brazil, China and Russia.
Olympic champions and favourites the United States are in a group featuring France, 2008 bronze medallists Argentina, Tunisia, Lithuania and Nigeria.