SAO PAULO — A Brazilian judge issued an arrest warrant Thursday for former President Luiz Inacio Lula da Silva, dealing a major blow to the once wildly popular leader who was trying to mount a political comeback ahead of October’s elections.

The warrant came several hours after the country’s top body, the Supreme Federal Tribunal, voted 6-5 to deny a request by da Silva to stay out of prison while he appealed a corruption conviction that he contends was simply a way to keep him off the ballot.

Federal judge Sergio Moro gave da Silva 24 hours to present himself to federal police in the southern city of Curitiba.