A former adviser to Canada's prime minister has apologised after causing outrage by saying that viewers of child pornography should not be jailed.

Speaking at an engagement in Alberta on Wednesday 27 February, academic Tom Flanagan told a class, "I certainly have no sympathy for child molesters, but I do have some grave doubts about putting people in jail because of their taste in pictures."

The comments were recorded and the video posted on YouTube, where they went viral.

On Friday 1 March, Flanagan apologised for the comments, and said in a statement: "[I] absolutely condemn the sexual abuse of children."

A respected political figure in Canada, the conservative acted as an adviser to Prime Minister Steven Harper until 2004, but following the comments has been sacked as a pundit on CBC's Power and Politics show, and a spokesman for Harper has branded the comments: "repugnant, ignorant and appalling".

Alberta's Wildrose Party, for which Flanagan served as a campaign manager in 2011, also cut ties with him.

The University of Calgary, where Flanagan is due to retire from a teaching post in June, also condemned the views, saying in a statement that they "absolutely do not represent" the institution.

Some fellow academics have come to Flanagan's defence, though.

Barry Cooper, who teaches political science on the same faculty as Flanagan, told the Globe and Mail: "That [Flanagan's] is a defensible position. It's not one that is held by most people in this country but it is, nonetheless, a defensible position.

"This is such a taboo subject that you simply cannot talk about it and, if you do, you're denounced."

Mark Mercer, who teaches philosophy at Saint Mary's University in Halifax commented in an editorial in the Ottawa Citizen: "He was doing what a professor should - raising and commenting on a matter of public concern - and for that he deserves to be commended.

"To ask whether people convicted of viewing child pornography should be sent to jail is to raise a fundamental question that requires us to investigate."

Flanagan created controversy two years ago when he suggested that WikiLeaks founder Julian Assange should be assassinated; comments he later retracted.