After almost 2 years behind bars, former NSW minister Ian Macdonald has been granted bail.

The former Labor politician was jailed for 10 years on two counts of wilful misconduct in public office in 2017.

Mr Macdonald was alleged to have favoured a mining company chaired by his friend, former union boss John Maitland, over the interests of the state, in granting a Hunter Valley coal exploration licence in 2008 without a competitive tender.

This week, five Court of Criminal Appeal judges quashed the 69-year-old's conviction and ordered a new trial.

The appeal judges found the original jury had been misdirected.

The jurors should have been told only to find Mr Macdonald guilty if he would not have exercised powers to grant consent to apply for the licence, and grant the licence itself, except for the illegitimate purpose of benefiting Mr Maitland.

Mr Maitland, who was jailed for six years on two charges of being an accessory to the alleged misconduct, had his sentence overturned too.

Mr Macdonald said he would take the opportunity to address several ICAC matters involving himself and others that he says have been blown out of proportion by the media.

“There was much in the way of exculpatory evidence that was hidden from the original enquiry which has set the scene, I believe, for victimisation that I have experienced in the media,” he said.

Mr Macdonald’s bail conditions require him to reside in the Blue Mountains, report to police weekly, and stay away from international departure points and prosecution witnesses.

Mr Maitland was also granted bail, and must reside in Sydney's eastern suburbs under similar conditions.