BUENOS AIRES — Argentines on Sunday entrusted leftists to steer the nation as it reels from a deep recession, electing as president Alberto Fernández, a longtime political operative who toiled behind the scenes most of his career.
His victory was masterminded by former President Cristina Fernández de Kirchner, a deeply polarizing leader who opted not to try for a comeback term as president, settling instead for the No. 2 spot on the ticket.
Throngs of supporters danced with joy outside the election headquarters of the Peronist leaders Sunday night.
With more than 80 percent of the ballots counted, Mr. Fernández had carved out a lead large enough to avoid a runoff with President Mauricio Macri, a center-right politician who failed to deliver on a promise that free-market policies would drive economic growth. Mr. Fernández was leading with more than 47 percent of the vote; Mr. Macri lagged behind with 41 percent.
The president-elect has yet to outline a clear road map for pulling the economy out of the dumps stabilizing the peso, which has been swinging wildly for months.
But as Argentines headed to the polls on Sunday, many harbored hope that putting Peronists back in the presidential palace would be the first step to turn things around.
“Peronism always enabled socioeconomic mobility and a more equitable distribution of wealth,” said Leonardo Duva, 43, who is one of the owners of a restaurant and bar in the San Telmo neighborhood of Buenos Aires that pays homage to the past two Peronist presidents.
The outcome of the election has appeared clear for weeks: President Macri, a former mayor of Buenos Aires who pulled off an upset victory in 2015, is widely expected to lose his bid for re-election.
His downfall was set in motion last May when Mrs. Kirchner, who preceded Mr. Macri, announced an unexpected comeback plan.
Instead of running for president again, Mrs. Kirchner, who is facing trial in one of 11 graft cases filed against her, opted to run for vice president and tapped Mr. Fernández, a veteran political operator who has never run for major public office, to lead the ticket.
Mrs. Kirchner, a populist center-left leader who governed Argentina from 2007 to 2015, left office with a badly damaged political brand. As president she alienated leaders of several factions within the Peronist political movement and sparred with powerful business sectors and news organizations.
But as Argentina’s economy plunged into a recession last year, she saw an opening to make a comeback. Maria Victoria Murillo, an Argentine political scientist at Columbia University, said Mrs. Kirchner appeared to have realized that she would have been too polarizing to win as a presidential candidate, and had burned too many bridges to govern effectively.
“She made a very smart calculation,” Ms. Murillo said. “She demonstrated a very interesting form of leadership.”
By picking Mr. Fernández to be her running mate, Mrs. Kirchner stunned the political establishment. Mr. Fernández, who served in several administrations in administrative jobs, had never signaled presidential aspirations, appearing more comfortable and effective working behind the scenes.
Besides a brief stint as a lawmaker in the city of Buenos Aires, Mr. Fernández has never held elected office, making him a rarity for modern Peronism, the movement that has dominated politics in Argentina since the 1940s. Named after Juan Domingo Perón, a military leader who ruled the country from 1946 until 1955, and then again from 1973 to 1974, the populist movement has swung right and left politically but has always claimed to be the guarantor of workers’ rights and social justice.
When Mrs. Kirchner’s predecessor and husband, Néstor Kirchner, was elected president in 2003, he appointed Mr. Fernández as his cabinet chief. It was a time of crisis. The country was reeling from the devastating 2001 economic collapse, during which Argentina defaulted on about $100 billion in debt.
Mr. Fernández stayed on briefly as cabinet chief when Mrs. Kirchner succeeded her husband in December 2007. But the two had a falling out, and Mr. Fernández became a withering critic of her leadership and her handling of the economy.
When Mrs. Kirchner announced her bid to return to power in May, with Mr. Fernández at the top of the ticket, videos of him criticizing his running mate quickly spread through social media.
But efforts to discredit him failed, said Jorge Giacobbe, a pollster in Buenos Aires. In the primary election in August, Mr. Fernández trounced Mr. Macri by a 16 percent margin.
The main term voters associate with Mr. Fernández’s candidacy is “hope,” Mr. Giacobbe said.
Mr. Fernández, 60, a law professor who continued to teach as he campaigned for president, has projected an image of an ordinary man who takes pleasure in simple things like belting out rock classics while playing the guitar. Early on Election Day, he took his collie, Dylan — named after Bob Dylan — to a park where they played fetch.
Mr. Fernández has staked out more liberal positions than Mr. Macri on social issues. The most notable is Mr. Fernández’s support for decriminalizing abortion. He has a close relationship with his 24-year-old son, Estanislao, who is bisexual and has promoted his father’s candidacy during drag performances at venues in Buenos Aires.
On economic issues, Mr. Fernández is seen as more pragmatic than Mrs. Kirchner. She was criticized for distorting economic figures and building a patchwork of unsustainable subsidies that set the stage for the state’s insolvency when commodities prices dropped during her time in office.
Several voters said on Sunday that they felt they had no good options.
“I have a tiny hope that something could change,” said Noelia Mirta Tassone, 42, as she left a polling station in the Palermo district of Buenos Aires. But her overriding feeling as she cast a ballot was one of hopelessness, she said.
“This is a country that stumbles into a crisis every 10 years, regardless of who is in power, said Ms. Tassone, who voted for Mr. Macri in 2015 but now wants him out. “I know they are all thieves, and I’m fed up of standing by while they all steal from me.”
Mr. Fernández has been vague about his plans to stabilize an economy mired in a deep recession amid rising inflation and the steady depreciation of the local currency. But political analysts and ordinary Argentines expect that he will adopt more protectionist policies than Mr. Macri, who has championed a free market approach.
Among his top challenges will be coming up with a plan to restructure Argentina’s debt to private creditors and the International Monetary Fund, which last year approved a $57 billion line of credit for Argentina, a record for the fund.
Argentina’s debt obligations rose to 72 percent of gross domestic product this year from 41 percent in 2015, according to estimates by Elypsis, an economic consultancy in Buenos Aires.
Amid fears that the country may once again default on its loans, which would deepen its economic crisis, investors have been hastily offloading Argentine assets. On Friday, Argentines lined up at banks to buy dollars and withdraw cash from their accounts.
Despite its persistent economic woes, Argentina has so far been largely immune to the public upheaval that has rocked several countries in the region in recent weeks as frustrations over entrenched inequality and poor governance boiled over into public protests. Some analysts caution that Argentines may soon join the wave of upheaval.
“The expectations that are being placed on Alberto Fernández to improve the economy are high, and if he does not manage to do it a more anti-establishment feeling could suddenly start to appear,” warned Daniel Kerner, managing director for Latin America of the Eurasia Group. “The Argentine vote has to do with a promise of no more austerity, and I’m not sure he can keep that promise.”
Yet, on Friday night, the mood at Santa Evita, a restaurant in Buenos Aires popular among Peronists, the mood was ebullient as the political movement’s anthem blasted from the speakers. Patrons twirled white napkins in the air as they sang along: “Long live Perón, long live Perón!”
“There’s widespread joy,” said the manager, Florencia Barrientos. “People are very hopeful.”