A 40-year-old man who sexually assaulted two girls under the age of 13 in Dumfries has been placed on the sex offenders' register for life.
Barry Reid, described as a prisoner at Barlinnie, was also jailed for three years with an extended period of three years after that under licence.
Reid admitted trying to pull down one girl's trousers at a house in Dumfries in December 2012.
He went into another girl's bedroom in April 2016 and touched her underwear.
In addition he pleaded guilty to breaching a sexual offences prevention order in 2012 prohibiting him from entering any residential address where he knew anyone under the age of 18 lived.
At Dumfries Sheriff Court, Sheriff Brian Mohan said that because of the gravity of the offences and Reid's previous history there was no alternative to custody.