By Daniel Trotta and Helen Murphy
BOGOTA (Reuters) - Colombia held local elections on Sunday that tested how much the South American nation has overcome its violent past and measured the political grip of popular conservative President Juan Manuel Santos.
About 100,000 candidates were contesting 13,000 posts on town councils and as regional governors in the first nationwide vote since Santos, a U.S. ally and former defense minister, took office in August 2010.
Soldiers and police were out in force at voting stations and other installations after a bloody campaign in which 41 candidates were killed, many by criminal gangs trying to ensure the election of their favorites.
There was no sign of violence several hours into voting on Sunday. A peaceful election day would help counter concerns that security has eroded since Santos took over from Alvaro Uribe, whose presidency saw leftist rebels pushed back.
Colombia's next presidential poll is in 2014. While Uribe cannot run again, he could back an anti-Santos candidate and Sunday's vote was seen as a crucial test of how much clout he may have in the presidential race.
The campaign violence was a reminder Colombia has yet to fully escape its bloody past even as it benefits from foreign investment and rising oil and mining sectors due to better security on the ground and a fast-growing economy.
After winning the presidency last year with record vote tally, Santos quickly passed laws to shore up state finances, distribute oil windfalls more equitably and return land to peasants displaced by decades of conflict.
"Vote with conscience, vote for the best and most honest candidates, vote against corruption, against violence," Santos said after casting his ballot in Bogota.
While his approval rating remains above 70 percent, the Santos government has seen a flare-up in violence from criminals and leftist rebels.
The Marxist-inspired Revolutionary Armed Forces of Colombia, known as the FARC, killed 20 soldiers in two days last week and criminal gangs have infiltrated the election, putting up their own candidates to try to control the distribution of oil wealth.
Local elections tend to be bloody and, in some ways, the fight over resources, the remoteness of many areas and the sheer number of candidates make the poll more important than national elections to the daily lives of many Colombians.
"It's so important that we all have a voice," Mauricio Ascencio, 36, said after being patted down by police at a heavily guarded polling station in Bogota. "It's so important democracy exists for all of us."
Colombia has achieved remarkable progress in its security and business climate, beginning with the 2002 election of Uribe, whose U.S.-backed military offensive hurt the rebels.
Uribe left office with a 75 percent approval rating and since then has chided Santos in a stream of Twitter messages and speeches over slacker security.
Now Uribe has endorsed a preferred candidate for mayor of Bogota, a city of 8 million people, putting his reputation as a behind-the-scenes power broker on the line.
Uribe is backing Enrique Penalosa, who held the post in 1998, against Gustavo Petro, an anti-corruption champion and former fighter for the defunct M-19 leftist rebel group.
(Additional reporting by Julia Symmes Cobb; Editing by Andrew Cawthorne and John O'Callaghan)