Nicola Sturgeon has said she understands concerns surrounding a "wholly exceptional" court decision in which a student found guilty of sexual assault of a child was granted an absolute discharge.

However, the First Minister said it is right that sentencing decisions - no matter how controversial - are made by the judiciary, without interference from politicians.

Ms Sturgeon spoke in response to a question by Conservative MSP Liam Kerr, who claimed the sheriff's decision had "devastated" the victim's family.

A statement relating to the case of Christopher Daniel at Dumbarton Sheriff Court has recently been made available by the Judicial Office for Scotland.

It states that first offender Daniel, who was 17 at the time when he was found guilty of sexual assault in December, was "discharged absolutely". He is now aged 18.

Noting that Sheriff Gerard Sinclair had considered all the relevant factors in the case, the statement said: "In light of the evidence as to the immaturity of the accused, and the nature of the discussion during which he admitted his actions, the sheriff considered the offence to be the result of an entirely inappropriate curiosity of an emotionally naive teenager rather than for the purpose of sexual gratification.

"The accused had appeared both noticeably immature and socially awkward, features confirmed by other evidence in the case. It was fortunate that the complainer appeared to have suffered no injury or long lasting effects."

It concluded: "Considering all of these factors, the sheriff reached the conclusion that justice could be served in this case by taking the wholly exceptional decision not to pass sentence and to grant an absolute discharge."

The victim's family told STV News they were "gobsmacked" by the judicial statement. Daniel's solicitors said the statement had disclosed confidential medical information and that serious threats had been made to him on social media.

During First Minister's Questions at Holyrood, Mr Kerr asked: "I know the First Minister cannot comment on individual cases, but does the First Minister agree with me that serious sexual offences against children should be punished severely and that we need to see more transparency around sentencing such as this?"

Ms Sturgeon said: "In general terms, of course I agree with the sentiment of that question.

"In terms of this particular case, I'm grateful to the member for acknowledging that I cannot comment on the detail.

"I absolutely understand the concerns that have been expressed about what has been reported about this sentence, but the sentencing decision in any criminal case is entirely a matter for the judge.

"The judiciary acts entirely independently on the basis of the facts and circumstances of individual cases. They will take into account a wide range of factors, including the age of the offender and any previous convictions.

"I understand the concerns, but we must protect the principle in this country that sentencing decisions are not a matter for politicians, however controversial and difficult they can be for the public. Sentencing decisions are rightly and properly matters for judges."