Former NSW Labor minister Ian Macdonald and his former union boss friend John Maitland have had their convictions over the granting of a multimillion-dollar coal exploration licence set aside and a retrial has been ordered.

In mid-2017, NSW Supreme Court Justice Christine Adamson sentenced Mr Macdonald to at least seven years behind bars and Mr Maitland to at least four over a direct allocation licence in December 2008 to Doyles Creek Mining, a company Mr Maitland chaired, while Mr Macdonald held the minerals portfolio.

Ian Macdonlad has had his conviction thrown out. Credit:AAP

A jury had, earlier that year, found Mr Macdonald guilty of two counts of public misconduct over the lucrative deal, while Mr Maitland, who had made $6 million from the sale of shares relating to the deal, was found guilty as an accessory.

The pair appealed, and, in its decision on Monday, the NSW Court of Appeal quashed their convictions and ordered a retrial, finding Justice Adamson had not properly directed the jury on the mental element of Mr Macdonald's offending.