The timing of the order from Judge Sergio Moro, head of Brazil's huge "Car Wash" anti-graft probe, came as a complete surprise, given that lawyers said earlier that the leftist former two-term president had at least until next week before going behind bars.
Lula, 72, easily leads polls in Brazil's October presidential election and his apparent downfall will throw the race completely open. Currently, hard-right former army officer Jair Bolsonaro, who openly praises Brazil's 1964-1985 dictatorship, is in second place.
Moro's order said that in view of Lula's stature as a former president, he would have "the opportunity to present himself voluntarily" to police in the city of Curitiba, where the "Car Wash" probe is based, by 5:00 pm (2000 GMT) Friday, April 6.
A special cell "was prepared in advance... in which the ex-president will be separated from other prisoners, with no risk for his moral or physical integrity," Moro wrote.
There was no immediate reaction from Lula, who had been described earlier by supporters as facing his jailing calmly.
However, Senator Lindbergh Farias, from Lula's Workers' Party, issued a defiant call for supporters to congregate in front of Lula's house in Sao Bernardo do Campo, a suburb of Sao Paulo, on Friday.
"Moro ordered prison for Lula. Everyone to Sao Bernardo tomorrow from 5:00 am in front of Lula's house!" he tweeted.
The party also tweeted a call for "general mobilization" in Sao Bernardo do Campo.
Lula had been due to address a Workers' Party rally in the city on Friday afternoon, but that event would now coincide with Moro's surrender deadline.
Lula petitioned to the Supreme Court on Thursday to be allowed to remain free while pursuing appeals in higher courts against his conviction for receiving a seaside apartment as a bribe from a construction company. A lower court appeal failed this January.
However, the Supreme Court judges ruled 6-5 in a marathon session that under the law, Lula must begin his sentence after having lost that first appeal.
Still, it had been widely expected that with more technical appeals, Lula would start his sentence only sometime next week at the earliest.
Brazil's left is furious at the Supreme Court ruling, seeing Lula's imminent imprisonment as a plot to prevent the Workers' Party from returning to power. Party leader Gleisi Hoffmann said the court ruling violated "constitutional law and the presumption of innocence" and made Brazil "look like a little banana republic."
However, there were celebrations on the right and among prosecutors supporting the epic "Car Wash" probe, which has revealed high-level corruption throughout Brazilian business and politics over the last 4 years.
To them, Lula epitomizes Brazil's corruption-riddled elite. His conviction is "Car Wash's" biggest scalp by far.
Operation "Car Wash" was named after the service station where agents initially investigated a minor money laundering scheme in 2014, before realizing that they'd stumbled on a gargantuan web of embezzlement and bribery at state oil company Petrobras and right through the political classes.
Campaign from behind bars?
Lula, who grew up poor and with little formal education before becoming a trade union leader and politician, says he will go down fighting. When he left office in 2011, he had some of the highest approval ratings of any leader in the world.
Analysts say that his election hopes have now been dealt a body blow. But he is not necessarily knocked out.
In theory, once someone has been convicted and lost their lower court appeal, they are barred from running for office under Brazil's clean slate law. But the issue will not be decided for months.
Lula has until mid-August to register his candidacy and only after that will the Superior Electoral Tribunal rule on whether his candidacy is valid.
Even if he were barred, as seems likely, he would have an opportunity during that period to exercise influence on his followers, possibly preparing the way for a replacement candidate.
"The party's idea is to maintain his candidacy whatever the circumstances until the (election court) turns him down, and to start working on a name as plan B," Globo political columnist Gerson Camarotti wrote Thursday.
Michael Mohallem, a politics professor with the Getulio Vargas Foundation, said "he probably won't have the conditions to be a candidate."
"Brazilians would surely have trouble with this, rejecting a candidate who was in prison," he said.
In the latest election polling, Lula scores more than 30%, with his nearest rivals in a crowded field, including Bolsonaro, getting only around half that.
Current center-right President Michel Temer – who took over in 2016 after the hugely controversial impeachment of president Dilma Rousseff from Lula's Workers' Party – is himself accused of serious corruption.
Temer however has been shielded by Congress, which is dominated by his allies, and has not had to face trial.
A new poll from Ibope that was published Thursday showed only 5% of Brazilians think Temer's government is doing a good or very good job. – Rappler.com