Key legislation has been passed in Brazil to comply anti-doping laws with international standards ahead of Rio 2016 ©Getty Images

A major catastrophe has been avoided ahead of the Rio 2016 Olympic and Paralympic Games after sporting drugs legislation was passed in Brazil with just one day to go ahead of a World Anti-Doping Agency (WADA) imposed deadline.

Brazil was one of six countries placed on a compliance "watch list" at the WADA Foundation Board meeting in Colorado Springs last November, with non-compliance threatened if the changes were not made ahead of tomorrow.

In Brazil's case this was particularly hazardous as non-compliance would involve the revoking of accreditation for the laboaratory in Rio de Janeiro, where testing is due to take place during the Olympics and Paralympics.

All doping cases must be heard in an independent specialised tribunal, as opposed to a general sports court, as in the current system, it was ruled.

Measures must also be made to ensure the independence of the Brazilian Anti-Doping Agency (ABCD).

Brazilian officials had been hoping the changes would be steamrolled through via a Presidential Decree on Tuesday (March 15).

This did not happen, however, as concerns rose as the deadline neared.

The Government's official gazette has now confirmed the necessary changes have been passed in a Presidential Decree.

Doping legislation has been passed in Brazil ahead of the Rio 2016 Olympics
Doping legislation has been passed in Brazil ahead of the Rio 2016 Olympics ©Getty Images

"Trials on Brazilian soil regarding doping in sport must take place in the Sports Anti-Doping Justice [system]," the official announcement said.

Cases should now be heard within the international standard of a maximum of 21 days, rather than the more common Brazilian time-frame of 60 days.

It comes as a major relief to Rio 2016 organisers as they still have battle several other major problems with less than five months until the Olympic Opening Ceremony on August 5.

It marks a "historic breakthrough in the fight for clean sport in Brazil", a statement from the office of the country's President Dilma Rousseff proclaimed.

Last week it revealed that leading Brazilian sprinter Ana Cláudia Lemos, the South American 200 metres record holder, has failed a doping test and is set to miss Rio 2016.

Belgium, France, Greece, Mexico and Spain were placed on a similar warning list by WADA in November.

Spain appear to be most in danger of not meeting the requirements by the deadline tomorrow.