Updated

Argentina's Senate on early Thursday approved the forced takeover of the YPF oil company from Spain's Repsol.

The expropriation bill passed 63 to 3, with 4 abstentions. President Cristina Fernandez's allies control the Senate, and even opposition legislators said they would vote for the takeover even though they don't like the way Fernandez handled it.

Next week the bill will be voted on in the Chamber of Deputies, where it is also expected to pass.

Taking back Argentina's largest company from Spain's biggest company has proven hugely popular in the South American country, despite threats of retaliation from the Europe Union and fears of unintended consequences in the years ahead.

Fernandez infuriated Spain, Argentina's largest foreign investor, but elated many Argentines by expropriating Repsol YPF SA's majority stake in Argentina's formerly state-owned YPF energy company.

Only two months ago, Repsol YPF upped its estimate for the shale oil and gas it found in Argentina to nearly 23 billion barrels, enough to double the country's output in a decade. But the Spanish company said it would cost $25 billion a year to develop, and warned that Argentina would need to overhaul its energy policy to attract the necessary investment.

Instead, Fernandez simply seized the company, giving her government access to billions of dollars' worth of cash, enough energy to answer domestic demand in the short term, and potentially even solving Argentina's chronic money woes in the future.

She accused Repsol of draining YPF since gaining control in the 1990s, underinvesting in its oil and gas fields and failing to keep pace with the needs of Argentina's growing economy even as it paid huge dividends to shareholders.

Repsol blames Argentina's ever-changing mix of subsidies, price caps and export taxes for depressing production as the country's demand for energy soared since 2003, when her husband, President Nestor Kirchner, came to power.

Argentine oil production plunged 22 percent from 2000 to 2010, even as demand surged more than 40 percent, according to data from the Argentine Oil and Gas Institute and the Energy Ministry compiled by a former energy secretary, Emilio Apud.

Argentina's production has fallen so low that the government now spends billions of dollars a year on expensive imported fuels that it provides at a loss to companies and consumers.

Cheap energy helped Argentines rebuild after a world-record debt default and devaluation in 2002 left the economy in ruins. It makes less sense now, after nearly a decade of growth, but letting consumer energy prices rise too quickly could cause already high inflation to spiral, and provoke popular discontent in a country where pot-banging street protests have driven other presidents from office.

Latin America's third-biggest economy hasn't been able to tap international debt markets since its default, but has been able to manage with dollars rolling in from taxes on grains, nationalizing private pension funds and the flagship airline, and by tapping central bank reserves.

By re-nationalizing YPF — and not paying Repsol until international courts resolve the case years from now, if then — Argentina can reinvest profits to develop new reserves and use the fuel Repsol was exporting to save consumers from price shocks as it weans them off the subsidies.