Brazilians have protested in recent weeks against the measure.
The proposal comes amid a major corruption investigation at the state oil company, Petrobras.
Mr Temer took office in May promising to tackle corruption, following the impeachment of Dilma Rousseff.
But several members of his cabinet have already resigned amid allegations of misuse of power.
‘Voice of the street’
The left-wing opposition, still angry with the dismissal of Ms Rousseff, had promised to fight against the unpopular amnesty law.
Announcing he would block the bill, Mr Temer said: “It would be impossible for a president of the Republic to sanction such a proposal.”
“It was necessary to listen to the voice of the street,” he added.
“We all agreed there isn’t the slightest basis for going ahead with this proposal.”
The Speaker of the lower house of Congress, Rodrigo Maia, told the news conference that lawmakers would vote on the anti-corruption bill on Tuesday.
But he agreed with the Speaker of the Senate, Renan Calheiros, and Mr Temer, on the need to persuade party leaders not to table the controversial amendment to the proposal, which would benefit politicians who received undeclared donations in previous elections.
The opposition has also protested against legislation introducing major cuts on social spending and other programmes introduced by the governments of Dilma Rousseff and Luiz Inacio Lula da Silva over the past 13 years.
Mr Temer said his government had to act to control public spending and help the country pull out of recession.