Late Silva strike saves Spain
The world and European champions looked to be heading for a frustrating draw until Manchester City midfielder Silva, who had replaced Xabi Alonso 10 minutes earlier, poked the ball past David Ospina in the 86th minute.
Villa, who is Spain's joint top goalscorer on 44 with Raul, had come closest to breaking the stalemate when he struck a shot against the post in the 15th minute and then narrowly missed the open goal from a tight angle from the rebound.
Victory for Spain ends a poor run of form in friendlies, although coach Vicente del Bosque may be concerned at the number of times his players surrendered possession in the second half and allowed 50th-ranked Colombia a host of scoring chances.
The Spanish are riding high in Euro 2012 qualifying, with three wins out of three, but slipped to a 4-1 friendly defeat in Argentina in September and a 4-0 loss in Portugal two months later after drawing 1-1 with Mexico in August.
"The Colombians were very well organised and made it hard for us to get into our stride, especially in the first half," Del Bosque told a news conference.
"It was a very intense match but we mostly played with focus and I am happy with the players who featured."
There was a carnival atmosphere at Real Madrid's packed Bernabeu stadium, with thousands of Colombians vying with the Spanish to provide the noisiest support for their teams.
The visitors, playing Spain for the only the second time after a 1-1 draw in a friendly in Bogota in 1981, struggled to get the ball in the early stages as the hosts quickly settled into a rhythm.
After Villa's effort and a chance for Colombia's Abel Aguilar, there was scarcely any goalmouth action until Colombia's Pablo Armero beat two challenges in first-half added time and fired off a shot that flew narrowly wide.
The second half was a similar story and Del Bosque and his Colombian counterpart Hernan Dario Gomez made a slew of changes that broke up the flow of the match.
The Spanish players made some uncharacteristic errors to give away possession and substitutes Juan Guillermo Cuadrado and Hugo Rodallega both went close before Silva struck the winner.
Gomez said the performance of his players would help the team's development and lead to some better results.
"We played a solid tactical game and at times were able to take some of the fluidity out of the Spanish play," he told a news conference.
"I made the changes to give the players a chance to continue their development against the world champions.
"We suffered from fatigue towards the end as it is very tiring playing football without the ball."
The game was being played in aid of the Spanish football players' union (AFE), with some of the proceeds to be used to buy defibrillators for lower-league clubs.
Spain top Euro 2012 Group I and continue their qualification bid on March 25 at home to Czech Republic and four days