* Imprisonment increases chances for centrist in 2018 election
* Lula's Workers Party defiant in defending his right to run (Recasts with judge's order)
BRASILIA, April 5 (Reuters) - A Brazilian judge on Thursday ordered former President Luiz Inacio Lula da Silva to turn himself in to police within 24 hours to serve a 12-year sentence for a bribery conviction, likely ending the presidential frontrunner's hopes of returning to power.
An appeals court in January upheld Lula's conviction for taking bribes from an engineering firm in return for help landing contracts with state-run oil company Petroleo Brasileiro SA.
Earlier on Thursday, Brazil's Supreme Court rejected Lula's plea to remain free until he exhausts all his appeals, in a corruption case he calls a political witch hunt.
The ruling likely ends his political career and any chances he has of running for president, despite opinion polls showing he would easily win a first-round vote in an election scheduled for October.
Brazilian financial markets rallied on Thursday after the Supreme Court decision, which plunged the left into disarray and increased the chances a centrist will win the election, according to analysts and political foes.
A defiant Workers Party, founded by Lula, said its supporters would take to the streets to defend his right to run. A candidate is forbidden by law from running for elected office for eight years if convicted of a crime.
"Lula continues to be our candidate, because he is innocent, and because he is the leading candidate to become the next president of Brazil," said Workers Party leader, Senator Gleisi Hoffmann.
Lula served two four-year terms as president from 2003 to January 2011 and left office with an approval rating higher than 80 percent.
His endorsement was enough to get his hand-picked successor Dilma Rousseff elected twice. Rousseff was impeached and removed from office amid corruption scandals and economic crisis in mid-2016.
(Reporting by Anthony Boadle; additional reporting by Eduardo Simoes and Brad Brooks in Sao Paulo; editing by Brad Haynes and Rosalba O'Brien)