England's friendly against Brazil will go ahead on Sunday after a safety certificate was granted for the Maracana stadium.
The fixture had been thrown into doubt when a local judge issued an order saying the match at Rio de Janeiro's renovated ground could not proceed due to safety concerns.
But Judge Adriana Costa dos Santos has reversed her ruling and a statement from the Rio state government confirmed the stadium complies with "all safety rules".
"All safety requirements for the friendly between Brazil and England have been complied with and, because of a bureaucratic failure, the appraisal from the public ministry that proves the compliance with the rules on safety at the Maracana have not been sent to Suderj," the statement read.
Suderj is a division of the Rio de Janeiro state authority that holds responsibility for administrative issues with major sports venues.
The renovation of the 78,000 seater Maracana was completed last month, but a prosecutor submitted a request for the match to be cancelled because of a lack of assurances that work on the stadium had been finalised.
Fears were raised that debris left over by construction workers could be hurled in the event of a disturbance and reports suggested there could be a problem with flooring.
The confusion surrounding this game raises questions about Brazil's readiness to hold the Confederation Cup, which opens in two weeks, as well as next year's World Cup and the 2016 Rio de Janeiro Olympics.