By Alonso Soto and Maria Carolina Marcello

BRASILIA (Reuters) - Brazil's interim President Michel Temer on Wednesday proposed a constitutional amendment to limit public spending growth for up to 20 years, one of the most far-reaching fiscal reforms in decades designed to curb a runaway rise in public debt.

The government, including the legislative and judiciary branches, will be obliged to limit annual spending growth to the inflation rate of the prior year if the flagship reform is approved in Congress, according to a Finance Ministry statement.

The move signaled a victory for economic hardliners in the cabinet, led by Finance Minister Henrique Meirelles, who overcame calls from a faction pushing for a shorter cap.

Meirelles told a news conference a decisive move was necessary to restore investor confidence and the period would be long enough to have an impact on public debt levels.

"It is a great step forward, a change of concept," Meirelles said. "We are confident it will be approved."

Brazil posted a fiscal deficit of more than 10 percent of gross domestic product last year as its economy slid into the worst recession in decades. The rapid deterioration of public accounts has cost the country its coveted investment-grade credit ratings.

Bonds and stocks were little changed after the announcement, as investors focused on a rate-setting meeting in the United States.

"Brazil finds itself in a particularly acute fiscal position at the moment, but from a macroeconomic standpoint it's never a good idea to have too much rigidity on spending in either direction," said Neil Shearing, chief emerging markets economist with London-based research firm Capital Economics.

Temer's government has abruptly steered Latin America's largest economy to the right after 13 years of rule by the leftist Workers Party, in a trend towards market-friendly policies also seen in neighboring Argentina.

Temer could serve out the remainder of suspended President Dilma Rousseff's term, through the end of 2018, if she is found guilty of breaking budget laws. Her trial by the Senate is expected to last until at least August.

The interim administration will work on other measures to curb spending in the meantime, Meirelles said, mentioning pension reform. He added that the government has no plans to raise taxes at the moment.

The spending cap could be relaxed after 10 years, by which time the government hopes Brazil's finances will have improved. Federal institutions that do not comply with the cap will be barred from hiring new employees, Meirelles added.

The leader of Temer's ruling coalition in the lower house, Andre Moura, told Reuters the constitutional amendment was well received by Congressional leaders and would be presented to the lower house floor within at least 60 days. He voiced confidence it would be approved by legislators this year.

The head of the Senate, Renan Calheiros, nonetheless said on Tuesday that tough measures such as a debt ceiling should only be examined by Congress after Temer is confirmed in the presidency, according to the Senate news agency.

A source close to the discussions, which went on until early on Wednesday, told Reuters Temer was considering a shorter time limit for the spending ceiling, until the end of the next presidential term at the start of 2023.

Temer rejected the idea of making the ceiling permanent to facilitate the approval of the constitutional amendment, seen as unpopular with ordinary Brazilians.

The amendment requires three-fifths approval from the legislature. A web of laws and constitutional requirements has made most of government spending mandatory, including payrolls and investments in education and healthcare.

Failure to control spending growth could send Brazil's public debt to nearly 80 percent of gross domestic product by next year, from 67.5 percent currently, ratings agency Fitch said in May as it downgraded Brazil further into junk territory.

(Writing by Silvio Cascione; Editing by Daniel Flynn and James Dalgleish)