Brazil's friendly international against England on Sunday was in doubt after a judge reportedly failed to award the Maracana stadium a safety certificate, but the Rio de Janeiro state government ultimately reversed the decision.
The game marks the reopening of the famous Maracana arena, but on Thursday construction work was still ongoing with the match just three days away.
A report in Sao Paulo-based newspaper Estado said that a state prosecutor had submitted a request for the match to be cancelled because of a lack of assurances that work on the stadium was complete.
Judge Adriana Costa dos Santos has applied an injunction to suspend the fixture, saying: "Despite numerous requests from the public ministry [the state prosecutor], the reports were not delivered in their entirety and we do not have at this moment the proof the the stadium meets the minimum requirements necessary to put on matches or events.
"Because of the inaction of those responsible, there is no way we can allow the stadium to be reopened without the proof that it is in satisfactory conditions for hygiene and safety.''
Later, the Rio state government confirmed the safety certificate had been granted.
"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.
It was reported widely in Brazil that the cost of putting on the game without the appropriate safety certificates would be a fine of one million US dollars (£650,000), payable by the CBF and match organisers.
Information from the Press Association was used in this report