A Saskatchewan man who refused to stop posting racist messages on websites is going to jail.

On Wednesday, a Federal Court judge sentenced Terry Tremaine of Regina to at least 30 days in jail for acting in contempt of an order of the Canadian Human Rights Tribunal.

Tremaine, a former University of Saskatchewan math instructor, was found in 2007 to have posted messages online that attacked people of various races.

"The theme of Mr. Tremaine's messages was that Jews, blacks and other non-whites are destroying Canada and they should either be deported or segregated," Justice Sean Harrington said.

"They were described as vermin, a disease, parasites, criminals, scoundrels, embezzlers and liars. They were portrayed as dangerous and in some cases intellectually inferior."

Tremaine was ordered to stop posting such messages and when he failed to do so, he was slapped with a contempt order.

In a sentencing decision released Wednesday, Harrington ordered Tremaine to take steps to remove his posting from two websites — Stormfront.org and the National Socialist Party of Canada website.

If Tremaine complies with the order, his jail sentence is 30 days. If he refuses, he faces another six months behind bars, the judge said.

"Mr. Tremaine has clearly intended to flout the law, to demean the Tribunal and this Court," Harrington wrote in his decision, adding that Tremaine apologized at one point, but later recanted.

"I do not expect Mr. Tremaine to apologize," Harrington said. "He is a true believer. He is free to flout the order I am about to issue, but he must remember that freedom has its price."

Tremaine has been in and out of court in Saskatchewan, on matters relating to his online activity, for several years.

In September, a Queen's Bench judge stayed a criminal code charge of promoting hatred, because the case was taking too long to get to trial.

Justice Fred Kovach said the case had been dragging through the courts for more than four years and any trial date would still be several months ahead.

He ruled Tremaine's constitutional right to a trial within a reasonable time had been violated and as a result, the case couldn't go ahead.

At that court proceeding it was learned that Tremaine was living on welfare.