"Now that the constitutional and legal procedures have ended, the government of Spain respects the National Election Board's proclamation of Nicolas Maduro as the president-elect of the Republic of Venezuela," the foreign ministry said in a statement late on Tuesday.
Spain's Foreign Minister José Manuel García Margallo had initially declined to recognize Maduro, a former bus driver who became Hugo Chavez's protege, as the winner of Sunday's presidential election in the former Spanish colony, prompting an angry response from Caracas.
"Whatever the outcome, whatever the final verdict after the count, what it shows is that there is a very strong political polarization in Venezuela," he told reporters on Monday in Madrid's first reaction to the poll result.
Spain's position contrasted with that of Argentina, Bolivia, Chile, Ecuador and Russia which promptly congratulated Maduro.
"Be careful Spain, be careful because Venezuela is free because we achieved independence. Government of Spain, respect others to be respected," Maduro said in response to the Spanish foreign minister's comments.
In the election to replace leftist president Chavez, who died last month, his designated political heir Maduro on Sunday defeated Henrique Capriles by a tight 1.7 percent.
Capriles demanded a full recount, but Venezuela's National Electoral Board has declared Maduro the winner.
Violent protests over the outcome of the election swept parts of Caracas and other Venezuelan cities on Monday night after the board announced its decision.