(Updates with final vote tally, context, quotes from Temer)
By Anthony Boadle
BRASILIA, Aug 2 (Reuters) - Brazil's lower house of Congress voted on Wednesday to reject a corruption charge against President Michel Temer for allegedly taking bribes, saving him from facing a possible Supreme Court trial that could have ousted him from office.
Temer won enough ballots to keep the opposition from gaining the two-thirds of the vote required to move the corruption case forward to the top court.
But his support was less than hoped for and raised questions about the future of his economic reform agenda and how he will fare in future Congressional votes on more charges likely to be lodged against him.
The final tally showed 263 deputies voting in favor of Temer, 227 voting against him - well below the 300 votes in favor of the president that Beto Mansur, the government's deputy whip in the lower chamber, predicted earlier Wednesday.
That puts in danger the chance legislators will even take up serious reform of Brazil's pension system that is crucial to plug a wide budget deficit and revive investor confidence in an economy emerging from recession. Several key lawmakers have told Reuters in recent weeks they were inclined to shelve that effort until after the October 2018 presidential election.
But Temer vowed after the vote to press on, saying that "we will pass all the reforms that the country needs."
He added: "Now it is time to invest in our country. Brazil is ready to start growing again."
Opposition lawmakers, carrying briefcases stuffed with fake money, chanted "Out with Temer!" on the House floor at the start of the day-long tumultuous session.
Temer's main coalition ally, the Brazilian Social Democracy Party (PSDB), which seeks to win the presidential election next year, was split on whether to back Temer, whose economic policies it shares, or distance itself from his corruption-plagued government.
PSDB leader Ricardo Tripoli, calling for the charge to be approved, said Temer must be investigated, "not because we want to oust the president, but because Brazilians are tired of so much suspicion surrounding their politicians."
To shield Temer only further undermines the credibility of Brazil's political system, Tripoli said.
Brazil's stocks and currency rose earlier on Wednesday after a cloture vote signaled a victory for Temer and robust support for his reform agenda to cut spending and restore confidence in government accounts.
Brazil's top prosecutor Rodrigo Janot in June charged Temer with arranging to eventually receive a total of 38 million reais ($12.2 million) in bribes from the world's largest meatpacker, JBS SA in return for political favors.
Temer and his legal team have denied any wrongdoing.
His supporters have said that Janot failed to provide proof that he had broken the law.
Lawmaker Paulo Abi-Ackel of the PSDB credited Temer with turning around the economy, falling inflation, interest rates and record unemployment, and early signs of renewed growth.
"Is this the right time to be removing the president?" he said on the House floor, appealing to his peers to clear Temer.
The deeply unpopular president had scrambled for support in recent days to avoid becoming the second president to be ousted in a year in a deepening crisis fueled by massive corruption investigations.
Temer's hold on office could become precarious if new corruption charges are brought against him as expected. With the 2018 election year approaching, key lawmakers have told Reuters they would find it harder to back him again later his year.
Janot has said he would file at least two more graft-related charges against Temer before he steps down in mid-September.
Janot is considering filing the charges of obstruction of justice and racketeering sooner now that lawmakers have rejected the first corruption charge, an official with direct knowledge of the investigation told Reuters, requesting anonymity to discuss the sensitive matter.
Janot's team has to provide evidence linking Temer to a payment made by JBS to his right-hand man, Rodrigo Rocha Loures, who was arrested in June after he was caught in a police video rushing out of a Sao Paulo restaurant with a bag full of cash handed to him by a JBS executive. (Additional reporting by Maria Carolina Marcello, Ricardo Brito and Lisandra Paraguassú in Brasilia, Bruno Federowski and Brad Brooks in Sao Paulo; Editing by Richard Chang and Lisa Shumaker)