He was the lord advocate who never forgot his roots.

Working-class and Catholic, Frank Mulholland QC never quite lived up to the stereotype for Scotland's top law officer.

As he stands down, it has emerged the 56-year-old has been signing recommendations to universities for future lawyers from underprivileged backgrounds.

Mr Mulholland last year prosecuted serial killer Angus Sinclair over the World End murders of Helen Scott and Christine Eadie in 1977.

The stakes were huge. This was a double jeopardy trial - Sinclair had already walked on the killings - and getting a conviction was huge for the Crown Office and Mr Mulholland.

Yet during his lunch hour, Mr Mulholland met with groups of HND students from New College Lanarkshire.

The result was a highly unusual collaboration under which the students wrote a guide to Scots Law for refugees and ending up getting their applications to university endorsed by the country's most senior prosecutor.

Mr Mulholland last week announced he would leave his post after a full parliamentary term following May's elections.

The 56-year-old said. "It's been an honour to do this job working with so many dedicated and talented people to deliver justice in some of the most demanding and challenging of cases."

Speaking on the eve of his announcement at a conference on hate crime, he revealed that tackling bigotry ranked among prosecuting murders, rapes, violence, domestic abuse, cold cases and housebreakings as his priorities.

Describing his prosecution of a student in St Andrews who put his hands down his trousers and then rubbed them on the flag of Israel, he said: "I am the Lord Advocate for all communities in Scotland and I am non-political, I don't favour one over the other. All people have a right to lead their lives without this kind of behaviour."

"What concerns me? If we are talking about priorities they have always been hate crime, violence.

"I changed prosecution policy so that all violence where there is sufficient credible and reliable evidence - unless there are exceptional circumstances - should be prosecuted.

"Sexual crime, rape and sexual abuse - is key priority. So is housebreaking.

"If you break in to a house you will now find yourself prosecuted on indictment I did not change the policy out of personal interest but I have been the victim of housebreaking - when I was younger and lived with my parents - and its a horrific crime. They say it is a crime against property but it is not, it's a crime against the person because of the violation of your own personal space."

On bigotry, he warned of the growth in abuse and crime online and the difficulty in containing the bile. "You feel like the wee boy with your finger in the dyke."

He added: "It is difficult to police it proactively. You have to be alive to social media where it is used as a vehicle to perpetrate hate-filled crime against individuals or sections of society. That is where law enforcement has to get involved.

"I am a passionate believer in freedom of expression but it has its limits and that is recognised in human rights."

Mr Mulholland previously said anything that would be considered a crime on the street should be considered a crime in cyberspace. Numerous court rulings, he added, had brought clarity about where social media strayed in to criminality. But the public needed to catch up. He said: "I have no desire to enter this whole debate on the use of social media. As a vehicle for debate it is a hugely positive thing. There is a line."

Banter, he added, was no excuse, suggesting 1970s sitcom Love my Neighbour would now be seen as potentially prosecutable if broadcast again.

Mr Mulholland, meanwhile, has praised Police Scotland, saying "some of the work the officers of our national police force do is world-beating".