By Nicolás Misculin

BUENOS AIRES (Reuters) - Argentina's Senate kicked off debate of a sprawling bill on Wednesday that is key to new libertarian President Javier Milei's economic reform plans, even as protests against the legislation grew outside Congress.

The upper house, which is divided almost down the middle over the bill, is set for a marathon debate. The bill passed the lower house of deputies in April at the second time of asking and with many changes.

Milei's government, which only has a small minority in both chambers, has been bargaining to win over allies. It knows the bill will be modified, but is hoping to at least get general approval for it. Outright rejection would be a major blow.

Local legislators and media outlets estimated that senators were evenly split. The bill needs 37 votes from the 72 total legislators in the chamber to get a majority.

"It is a very even vote: it's 36 and 36," Guadalupe Tagliaferri, a conservative lawmaker from the government-allied Together for Change, told reporters. She added the vote could come down to the vice president, who presides over the Senate, to break the tie.

The main left-leaning Peronist opposition bloc is likely to vote down the so-called "bases" bill and a separate fiscal package. The main bill includes plans for privatizing public firms, granting special powers to the president and spurring investment.

"We are going to vote to reject both," Jose Mayans from the Union por la Patria coalition told local TV channel A24. "It is an unconstitutional law."

Milei, a brash economist and former pundit who has clashed with lawmakers and regularly called Congress a "nest of rats", has tied a lot to the bill. His government says it is key to undoing a major economic crisis that it inherited.

Argentina has annual inflation near 300%, myriad capital controls that stymie business and trade, depleted foreign currency reserves and a high debt load that needs servicing. The economy is also in recession and poverty is rising.

"The effort Argentines are making during these months is enormous. We hope today to be able to take a firm step to lay the foundations for progress," Senator Bartolomé Abdala, of the ruling La Libertad Avanza party, said during the debate.

Outside Congress, thousands of protesters from social groups and unions demonstrated against the bill, facing off against riot police. The debate is expected to continue all day and into the night.

"They are going to have to buy popcorn because it is going to be a long night of trying to break the deadlock," La Libertad Avanza Senator Francisco Paoltroni told C5N.

(Reporting by by Nicolás Misculin; Editing by Adam Jourdan and Rod Nickel)