(For more stories on re-election, click on [ID:nN25131181]
* Court declares re-election referendum illegal
* Ex-minister Santos now favorite to win in May vote
* Markets see stability after Uribe (Adds Uribe, analyst, details)
By Patrick Markey
BOGOTA, Feb 26 A court blocked Colombian President Alvaro Uribe on Friday from running for re-election, making his former defense minister the favorite to replace the U.S. ally in a May presidential election.
Juan Manuel Santos leads in opinion polls, but the ruling marks the start of a tough campaign to replace Uribe, who during his eight years in power became the country's most popular president for his U.S.-backed war on leftist rebels.
The court voted 7-2 to reject a referendum on Uribe's re-election bid, citing irregularities ranging from the referendum's financing to its rocky passage through Congress.
Uribe told reporters after the ruling, "I accept and I respect the decision of the constitutional court."
Under Uribe, Latin America's oldest insurgency has ebbed and foreign investment has flowed steadily into Colombia, a country once considered a byword for a failed state.
Many Colombians praised Uribe as the man who managed to steer the country onto the right track.
Any candidate to succeed Uribe will likely not shift too far from his security policies, although most say they will seek to focus more on social development in the top coffee exporter and Latin America's No. 4 oil producer.
"Uribe's sidelining from the presidential race is unequivocally positive in our view, opening the door to a deep bench of candidates who are broadly in favor of policy continuity," said analyst Patrick Esteruelas at Eurasia Group.
Santos, a former defense minister closely associated with Uribe's security successes against FARC leftist guerrillas, has been ahead in most polls, if Uribe is discounted.
But Sergio Fajardo, an independent praised for his performance as Medellin major, is making ground, and another former defense minister and three-time candidate, Noemi Sanin, has gained recently in the polls.
The political transition could unnerve the local peso currency COP=RR and benchmark TES debt markets in the short term as investors absorb the change in command, but most analysts see long-term continuity in Colombian policy.
"While a constitutional court rejection may trigger a knee-jerk negative (peso) reaction, this is likely to be transitory as no major shift in economic, regulatory or security policy is expected," RBC Capital Markets said.
Uribe was re-elected once before in 2006 after his supporters pushed through a constitutional amendment to lift restrictions on incumbent presidents running for a second term.
But the move to change the law again for Uribe fueled worries over the threat to Colombia's democracy. His second term was marred by scandals over rights abuses by troops and illegal wiretapping on his opponents by the state spy agency.
His popularity has hovered above 60 percent during his nearly eight years in office. But the government's handling of an overhaul of the health service this month appeared to cost him politically after the measures triggered protests.
Colombians will vote next month in legislative elections likely to be a benchmark of Uribe's approval as his political coalition seeks to shore up majorities. But the elections could risk splintering the Uribe alliance.
Already Uribe's U Party and the Conservative Party -- two heavyweights in the president's coalition -- have clashed over whether they should present a unified candidate.
Violence and kidnappings from the country's four-decade-old war have eased, bringing a flow of investment especially in oil and mining. The next president must tackle high unemployment, a lack of state presence in rural areas and consolidate security gains outside major cities.
FARC rebels are still fighting in remote areas, ambushing troops and laying improvised land mines, new militia gangs engaged in drug smuggling are an increasing worry and the country remains the world's No. 1 exporter of cocaine. (Editing by Andrew Cawthorne and Peter Cooney)