Luiz Inácio Lula da Silva, the former president, has beat back a flurry of corruption cases and climbed to the front of next year’s presidential race.RECIFE, Brazil — The former shoe shine boy who rose to the presidency left office a little more than a decade ago with rock star popularity, the embodiment of a nation that appeared to be on the cusp of greatness.The downfall of that president, Luiz Inácio Lula da Silva, and of his country, Brazil, was just as dramatic. A corruption scandal landed him in prison and exposed the malfeasance and miscalculations that helped bring an era of prosperity to a screeching halt, dragging down Latin America’s largest economy and setting in motion a period of political turbulence.Now Lula, as he is universally known, is back.A string of courtroom victories freed him and restored his right to run for office, allowing Mr. da Silva to again make the case that he’s the only way forward for a nation grappling with rising hunger, poverty and a deepening political divide.“We have total certainty that it’s possible to rebuild the country,” he said recently.Homeless people lining up to receive lunch from volunteers from a religious group in São Paulo. In 2021, the number of people in poverty in Brazil tripled to 27 million, from 9.7 million in 2020.Mauricio Lima for The New York TimesA return to power would be a stunning comeback for Mr. da Silva, 76, whose epic political career paralleled Brazil’s fortunes. He started as a labor leader and rose to prominence with the movement to end Brazil’s dictatorship of 1964 to 1985. After losing presidential elections three times, he won in 2002, steering the nation through a period of economic plenty and international prestige, when Brazil was tapped to give a party for the world as host of the World Cup and the Olympics.Voters are giving him a broad lead in next year’s presidential race, signaling that for millions, the memories of an ascendant, striving Brazil carry more weight than their reservations over the endemic corruption that marred Mr. da Silva’s legacy.His warm embrace by the presidents of Spain and France during a recent trip to Europe made clear that other leaders may also yearn for the Brazil of yore.But pulling off a victory may hinge on his ability to reframe the story of why Brazil unraveled so spectacularly after his presidency.While millions of Brazilians were lifted from poverty and inequality under his watch, many of the projects Mr. da Silva set in motion, critics argue, were unsustainable, wasteful and tainted by corruption.“They didn’t do what was necessary for the country, but what was necessary to remain in power,” said Marina Silva, a former environment minister in Mr. da Silva’s government who resigned over disagreements with the president’s approach to governance. “The ends justified the means.”Marina Silva, a former environment minister in Mr. da Silva’s cabinet, resigned in 2009 after disagreeing with the president’s approach to governance.Gabriela Portilho for The New York TimesMr. da Silva took no responsibility for the recession or for the huge bribery scandal that battered Brazil for years after he left office. And Brazilians turned their anger against Mr. da Silva’s handpicked successor, Dilma Rousseff, who was impeached in 2016 for improperly shifting public funds in an effort to mask the state of the economy before her re-election.Two years later, the country elected Jair Bolsonaro, a far-right former army captain who presented himself as Mr. da Silva’s polar opposite, praising the dictatorship and promising an iron fist against corruption and crime.Now Mr. Bolsonaro is facing a torrent of scandals, his administration ensnarled in investigations and his popularity waning, and Mr. da Silva is presenting himself as Brazil’s salvation.To understand Mr. da Silva’s promise, why it unraveled, and whether his return could deliver the stability and growth Brazilians crave, it helps to visit a small port community of artisanal fishermen that Mr. da Silva dreamed of turning into a flourishing manufacturing hub.‘The Brazilian naval industry is here to stay’Harbor workers restoring a ship at the Atlântico Sul shipyard as part of the Suape harbor project.Mauricio Lima for The New York TimesWhen Mr. da Silva took office in 2003, Brazil’s economy had managed to rein in inflation and was enjoying a commodities boom, giving the government a rare degree of fiscal flexibility. He quickly set in motion ambitious plans to reward the northeast, his birthplace and an electoral stronghold that is home to a little more than a quarter of the country’s population but nearly half its poor.The child of illiterate agricultural workers, Mr. da Silva, who grew up in a small shack with no electricity or plumbing, saw an opportunity to transform families like his by investing heavily in job-creating industries.The Brazilian Development Bank, which is run by the government, authorized a loan of $1.9 billion for a 1,090-mile railroad that would connect the agricultural heartland to two ports, including one just south of Recife, the largest city in the northeast and the capital of the state of Pernambuco.The Atlântico Sul shipyard seen from the abandoned Tatuoca island, which was privatized and had its residents removed from their homes for works in the Suape harbor project.Mauricio Lima for The New York TimesAlongside the Recife port area — at the easternmost corner of the continent, with easy access to European and African markets — two splashy projects broke ground. A new refinery signaled Brazil’s ambition to become a major oil producer. Plans for a shipyard, Estaleiro Atlântico Sul, boasted it would be the largest and most modern in the Southern Hemisphere.“The Brazilian naval industry is here to stay,” Mr. da Silva proclaimed in 2005, outlining plans for a network of shipyards. “Brazil is preparing for the next 10 years: growth, growth, growth.”The frenzy of construction was welcomed by residents of Tatuoca island, a small community of artisanal fishermen in the area. The jobs, they said, let them upgrade their shacks with luxuries that had been beyond their reach.Rodrigo José da Silva, a former worker at the harbor, fishing near his home in Suape.Mauricio Lima for The New York Times“It was a good life, with nice furniture, television sets, stereos,” recalled José Rodrigo da Silva, a fisherman born on the island.Mr. da Silva’s government created a patchwork of tariffs and financial incentives that let shipbuilders lock in contracts worth billions of dollars, guaranteeing work for at least two decades.“The idea was to use the naval industry to create jobs in the northeast,” said Nicole Terpins, the president of the shipyard near Recife.But there were plenty of reasons to be skeptical, said Ecio Costa, an economist at the Federal University of Pernambuco.A harbor worker at the Atlântico Sul shipyard.Mauricio Lima for The New York Times“You didn’t have the trained labor force, you didn’t have the supplies,” he said. “To build ships you need a whole supply chain, a technology sector, and those things don’t happen overnight.”The 75 families who lived on Tatuoca island began to question the benefits of the port complex expansion in 2009 when a dredger began scooping up chunks of the seabed to accommodate big ships.“The devastation began,” said Mr. da Silva, the fisherman. “Crabs vanished, fish vanished, everything began dying off, and we no longer had a way to make ends meet.”In 2010, residents on the island were told they would be evicted to allow an expansion of shipbuilding operations. All ended up abandoning their island homes in exchange for modest payouts and simple cookie-cutter houses on the mainland.“Many people living there didn’t know what a street was,” said Mr. da Silva, 37. “They prohibited us from returning to Tatuoca.”A path on Tatuoca island, which was abandoned to clear room for the Suape harbor project and its Atlântico Sul shipyard.Mauricio Lima for The New York Times‘We can be a great country’The forced displacement was broadly seen as part of the growing pains of a rising nation.Jobs in Pernambuco were suddenly plentiful and the path to them was open to more Brazilians. Investments in education and new affirmative action programs were enabling an unprecedented number of Black Brazilians to go to college.The discovery of vast offshore oil reserves in 2007 led an ecstatic Mr. da Silva to proclaim, in a speech: “God is Brazilian.”That year, the Brazilian Development Bank issued one of the largest lines of credit in its history: $1.2 billion to build 10 tanker ships. The bank also provided $252 million to build Estaleiro Atlântico Sul, which the bank projected would employ approximately 5,000 people and create 20,000 indirect jobs.On the international stage, Mr. da Silva was making waves.He helped set in motion a diplomatic alliance of major emerging economies that included China, India, Russia and South Africa. At the United Nations, he argued that nations like Brazil deserved a bigger voice — and a permanent seat on the Security Council.The sense of possibility and euphoria was perhaps best captured when thousands of Brazilians erupted in joyous celebrations in October 2009 after Brazil pulled off an upset in the contest to host the 2016 Olympic Games. It was a crowning achievement for Mr. da Silva.“I have never felt more pride in Brazil,” Mr. da Silva exclaimed. “Now we are going to show the world we can be a great country.”People stopped by the Olympic rings next to the Beach Volleyball Arena at Copacabana Beach to take photographs during the 2016 Olympics.Mauricio Lima for The New York Times‘Corruption became a means of governing’Mr. da Silva left office at the end of 2010 with an 80 percent approval rating, and Ms. Rousseff in place to build on his legacy.But she began to flail as commodities prices dropped and factions in Brazil’s notoriously transactional Congress began breaking ranks with the governing party.Ms. Rousseff was narrowly re-elected in 2014 as the economy entered a period of contraction that would soon turn into a deep recession. That year, federal law enforcement officials carried out the first arrests of the biggest corruption scandal in the nation’s history.President Dilma Rousseff in 2014. She was impeached two years later, after the economy soured and Brazilians became angry over accusations of corruption hanging over her predecessor’s government. Mauricio Lima for The New York TimesThe investigation exposed kickback schemes involving some of the country’s most powerful politicians and large companies that were awarded billions in government contracts. They included the state-owned oil giant Petrobras — the main client at the shipyard in Pernambuco — and the construction behemoth Odebrecht.Several prominent figures involved, including close aides to Mr. da Silva, struck deals with prosecutors in exchange for leniency. Their cooperation exposed the stunning extent of the malfeasance that had unfolded during Mr. da Silva’s presidency, which led to historic settlements with prosecutors in Brazil and the United States. Odebrecht agreed to pay $3.5 billion, the largest settlement in a foreign corruption case investigated by the U.S. Justice Department, and Petrobras agreed to pay $853 million.Deltan Dallagnol, one of the Brazilian prosecutors who led the investigation, said in an email that the governments of Mr. da Silva and Ms. Rousseff enabled “a pattern of structural and systemic corruption.” He added that the billions that companies agreed to return to government coffers, and the testimony of defendants who came clean, showed “that corruption became a means of governing the country.”Investigators soon zeroed in on Mr. da Silva, who was ultimately charged in 11 criminal cases involving alleged kickbacks and money laundering.Mr. da Silva during a campaign rally in São Paulo in 2017, before his imprisonment on corruption charges.Mauricio Lima for The New York TimesThe overlapping political and economic crises paved the way for the impeachment of Ms. Rousseff and rippled across the country, gutting several sectors — including the budding shipbuilding industry.Estaleiro Atlântico Sul unraveled. Petrobras abruptly canceled ship orders. Its credit line was suspended. And top executives at the two firms that built it were among those charged with corruption. Overnight, thousands of shipbuilders were laid off.It was far from an isolated case, said Samuel Pessôa, an economist at Getulio Vargas Foundation in São Paulo.“All the initiatives failed,” he said of the emblematic projects of the da Silva era. “Corruption was not the main factor; it was projects that were poorly planned, and the disconnect between the ventures that were launched and the conditions of Brazil’s economy and society.”Jair Bolsonaro as a federal legislator in his office in 2017. Behind him are the portraits of Brazil’s leaders during the military dictatorship.Lalo de Almeida for The New York Times‘The medicine Brazil found was stronger than the disease’When Brazilians went to the polls in 2018, Mr. da Silva was in jail, convicted of accepting renovations for an oceanfront apartment as a kickback from a construction firm.Landmark projects he had launched, including the railroad in the northeast and the shipyards, had become insolvent and paralyzed.Double-digit unemployment and a record number of homicides in 2017 made the electorate angry — and open to a disruptive presidential contender.Mr. Bolsonaro, who had been a fringe lawmaker for decades, channeled voters’ rage, presenting himself as an incorruptible politician. He easily defeated the Workers’ Party candidate, making an impressive showing in poor regions, including in Mr. da Silva’s home base of the northeast.João Campos, the mayor of Recife, who belongs to a center left party, said that three years later, millions of voters have come to regret that vote.Workers separating collected materials for recycling in Brasília Teimosa neighborhood, a low-income community in Recife.Mauricio Lima for The New York Times“It’s like you have a house with rats and cockroaches, and the solution you find is to set it on fire,” Mr. Campos said. “That’s what Brazil did.”Since he took office in January 2019, Mr. Bolsonaro has kept Brazil in crisis, picking fights with political allies and sparring with the Supreme Court justices overseeing investigations into his administration and members of his family.On his watch, unemployment rose, millions slipped back into poverty, inflation returned to double digits, and the pandemic killed more than 600,000 people.Recent public opinion polls show that if the election were held today, Mr. Bolsonaro would lose to all likely rivals.A banner depicting Mr. Bolsonaro as a devil during a demonstration calling for his impeachment in July over his handling of the pandemic.Mauricio Lima for The New York TimesOne recent head-to-head matchup by the Datafolha polling firm showed Mr. da Silva — who declined several interview requests — winning by a whopping 56 percent to Mr. Bolsonaro’s 31 percent.Some of the criminal cases against Mr. da Silva have unraveled as protagonists of the anti-corruption crusade fell into disrepute. Critical among them was Sergio Moro, the judge behind the conviction that sent Mr. da Silva to jail.Mr. Moro’s impartiality was questioned when he joined the Bolsonaro cabinet as justice minister and after leaked messages he exchanged with prosecutors during the investigation showed he had unlawfully provided them strategic advice.As the former judge’s once-sterling reputation was tarnished, several courts, including Brazil’s Supreme Court, issued a blizzard of rulings in favor of Mr. da Silva. The rulings, largely procedural, did not acquit him. But in practice they have all but given him a clear legal slate.Mr. da Silva, right, visiting a Landless Workers Movement settlement in Pernambuco state in August.Mauricio Lima for The New York Times‘He gave us priority’Given the torrent of scandals of the Bolsonaro era, an electorate that was once eager to crucify Mr. da Silva and his party has taken a more sanguine approach, said John French, a history professor at Duke University who wrote a biography of Mr. da Silva.“They were being indicted for not having been able to take money and corruption out of a political system where it has always been the essence of politics,” he said, arguing that Brazilian voters by and large have become resigned to political graft. “If you assume everybody is corrupt, the question is who really cares about you? Who feels for you? Who’s capable of doing something for you, something concrete?”Those questions have kept people like Rodrigo da Silva, the fisherman, loyal to Mr. da Silva.The shipyard where he once donned a uniform with pride is now overrun with weeds. The recruitment office is shuttered, the sign outside missing several letters.He has been unemployed since 2017. His electricity bill is months overdue. Raw sewage often bubbles up outside his home. But his eyes lit up when he spoke of the return of the former president who shares his last name.“The period during which I worked the most was when he was president,” he said. “Everybody steals. But he gave us priority.”Lis Moriconi contributed reporting from Rio de Janeiro. More