(Bloomberg) -- Samuel Garcia, who stepped down as governor of the Mexican state of Nuevo Leon to run for the presidency next year, said he was withdrawing from the race and returning to office to avoid being replaced by an opponent. 

“I have resumed functions as constitutional governor of the state,” Garcia said in a decree posted on his social networks on Saturday, adding that he won’t need a permit for the presidential campaign. “I have decided not to participate in the electoral race for president.”

After a complex legal battle for control of the state in which Garcia proposed several allies to replace him as governor while he was competing for the presidency, the Supreme Court on Friday night said Luis Enrique Orozco, an opponent, should become the interim governor. 

Garcia’s return will prevent his Movement Party from losing control of the state. The move had raised doubt about his ability to compete in June’s presidential election, as he was legally required to leave office before Saturday, exactly six months before the vote.

Orozco has refused to accept Garcia’s return and is claiming the position of interim governor, which could extend the legal battle, Reforma reported. It remains to be seen whether Garcia will be able to resume his duties in the midst of the legal dispute. Garcia’s Movement Party called a meeting on Monday to decide the next steps following his return to the governorship, according to Latinus.

Garcia, 35, has ranked third in several polls ahead of the election, with about 8% support. He was behind opposition candidate Xochitl Galvez and frontrunner Claudia Sheinbaum, member of the Morena ruling party and a close ally of President Andres Manuel Lopez Obrador.

Nuevo Leon, in the border with the US, has become one of the major targets for new investment in the country, propelling Garcia into prominence on the national stage.

Read More: Mexican Governor Luring Tesla Is 35 and Running for President

(Updates with Samuel Garcia’s decision in first two paragraphs. Changes headline.)

©2023 Bloomberg L.P.