A former Sydney Catholic boys' school teacher who sexually assaulted a student he was meant to be counselling has avoided jail after being sentenced today.

William Irwin, 55, was convicted in March of two counts of gross indecency on a 17-year-old boy in 1986.

Today, in the NSW District Court, he was given a six-month suspended jail sentence.

He continued to work with children, including as a religious studies teacher at St Aloysius school in North Sydney until 2009.

Irwin was asked to help the young, vulnerable boy after he had been sexually assaulted by another man in 1985.