Brazil will host England in a friendly on Sunday in Maracana football stadium after a court threw out a judge's order cancelling the match over safety concerns.
A court ruled that after an inspection, the recently renovated stadium did after all meet safety standards, a Rio court statement said.
The O Estado de Sao Paulo daily on Thursday quoted court sources as saying the Rio judge who earlier cancelled the match had acted on a request from state prosecutors.
They had said that there was no evidence Maracana meet "the minimum necessary conditions to host games or events".
But the authorities in Rio appealed that ruling before a duty judge.
They argued that because of a "bureaucratic mistake" the safety report had not been delivered to the relevant official.
They judge duly overturned the earlier ruling, clearing the way for the game to go ahead.
An estimated 74,000 people are expected to watch Sunday's match, which will be the second test for the stadium inaugurated on April 27 after a multi-million-dollar 30-month renovation.
The friendly will serve as preparation for the Brazilian national squad ahead of the Confederations Cup, which the country is hosting from June 15 to 30.