SAO PAULO — Former Brazilian president Luiz Inácio Lula da Silva was taken into police custody Saturday to begin serving a 12-year corruption sentence, one day after he defied a judge’s order to surrender at a federal police station.
Protesters tried to block da Silva’s car from leaving a metalworkers union in Sao Bernardo do Campo, where the former leader had been holed up.
But several bodyguards pushed back supporters trying to keep him from leaving. Da Silva then entered a police vehicle and was taken to a police station in Sao Paulo.
‘‘I will comply with the order,’’ he said to supporters at the union, where he had avoided prison for two days. ‘‘That way, they will know I am not afraid. I am not running. I will prove my innocence.’’
Da Silva, known to Brazilians as Lula, said he would “go there and face them eye to eye. The more days they leave me [in jail], the more Lulas will be born in this country.’’
The plan to surrender was a stunning reversal for Lula, a leading leftist and the front-runner in Brazil’s upcoming presidential election.
For two days, Lula defied a prison order and hunkered down in the union building, where he had led strikes during Brazil’s military dictatorship and vaulted to national fame.
The former president was convicted accepting bribes from a large Brazilian construction company in return for government contracts.
His refusal to turn himself in created a tense impasse between authorities and the one of the country’s most famous political icons. Lula has vowed to campaign from behind bars if necessary.
‘‘If my crime was putting poor, black people in universities, allowing poor people to eat meat, to have their own cars, have their own homes’’ Lula said, ‘‘then I will continue being a criminal in this country, because I will do much more.’’
Protests both in support of and against the former president flared throughout the country over the weekend.
Brazil’s federal police ruled out forcibly arresting Lula on Friday and entered talks with his defense team.
Lula denies any wrongdoing and has called the investigation a media-led political witch hunt. After holding out for two days at the union headquarters, Lula emerged Saturday morning to partake in a street Mass celebrating the birthday of his late wife.
Surrounded by former president Dilma Rousseff and leading members of the Workers’ Party, which he founded in 1980, he urged supporters to take action. ‘‘You will burn tires as you so badly wanted; you will represent me,’’ he said.
Other speakers emphasized peaceful resistance and urged calm.
‘‘This is a prayer for peace,’’ Rousseff said at the Mass. ‘‘Today, more than ever, it shows we are of peace. We are not for injustice or violence.’’
Earlier Saturday, a Supreme Court judge rejected a last-minute injunction that would have temporarily delayed Lula’s imprisonment.
In 2003, Lula was celebrated as the first working-class president in a country with stark inequality. During his mandate, Brazil rode a commodities boom and Lula became an international icon.
His social programs were credited with lifting 20 million people out of poverty, according to a World Bank study, and he left office with soaring approval ratings. He dreamed of making a comeback and reclaiming his place as the country’s leader through October elections.
But he has become the highest-profile figure ensnared in a sprawling corruption scandal that has tarnished Brazil’s political class. In addition to his current conviction, Lula faces six other corruption trials.
‘‘We see the return of this ‘us versus them’ dynamic, of poor versus rich, educated class against the working class, a theme that will dominate the electoral cycle,’’ said Alexandre Bandeira, a political consultant in Brasilia. ‘‘The question is whether he can maintain the activism of his supporters from behind bars.’’
Workers’ Party leaders say da Silva, 72, will still be the party’s candidate in October.
Technically, being jailed does not keep him off the ballot, but the country’s top electoral court will make final decisions about candidacies in August.
The court could block da Silva’s candidacy under Brazil’s ‘‘clean slate’’ law, which disqualifies people who have had criminal convictions upheld. He could appeal such a decision, though doing so from jail would be complicated.
Judge Sergio Moro last year convicted da Silva of trading favors with a construction company in exchange for the promise of a beachfront apartment. That conviction was upheld by an appeals court in January.
Da Silva rose through the ranks of the metalworkers union. In 1980, he was arrested in Sao Bernardo do Campo for organizing strikes. He spent more than a month in jail.
He served as president from 2003 to 2010, gaining approval ratings in the high 80s.