A gang member who gave a judge a Nazi salute and yelled "Sieg Heil" has successfully appealed the community work he was given for contempt of court.

The trouble for Mongrel Mob member Michael Wong Tong was that the High Court agreed that he could not be given community work for contempt - instead he was given seven days in jail.

Wong Tong was in the public gallery of the Dunedin District Court in April when a gang associate was ordered taken into custody. The gang member raised his fist and yelled "Sieg Heil", the Nazi salute that has been co-opted by the Mongrel Mob.

He and some associates then left the court "in an abrupt and noisy fashion" but Judge Crosby ordered Wong Tong taken into custody for his display.

He came back to the court later that afternoon and offered the apology: "I'm very sorry for what was done. Didn't know. It was a big understanding. It'll be the last time I see him for a while. I don't know. Got out of hand. It won't happen again. It was one of one."

Judge Crosbie sentenced him to 150 hours' community work. Wong Tong appealed his sentence and was, technically, correct.

In a judgment released last week, Justice John Fogarty said the law did not give the power to impose community work and any punishment for contempt had to be a fine or a period of imprisonment.

He said he was "quite satisfied" that it was a contempt of court and a fine would be inappropriate for someone on a benefit.

Justice Fogarty ordered Wong Tong's sentence quashed and one of seven days in prison substituted.