A teenager who simulated sex on a pavement in the Scottish Borders has been put on probation for 12 months.
Marshall was put on probation for 12 months for the offence
Steven Marshall, 18, of Woodstock Avenue, Galashiels, admitted a charge of public indecency on 17 June.
Selkirk Sheriff Court was told how he got into a press-up position with his trousers down on his home street and simulated sexual intercourse.
The court heard Marshall was "very ashamed" and it was decided not to put him on the sex offenders' register.
Procurator fiscal Graham Fraser said the teenager had been spotted by two people - one of them a young woman who lived nearby - while they were driving along Woodstock Avenue at about 2030 BST.
"They saw the accused lying on his back on the pavement jerking around," he said.
"As they drove past they could see his trousers were down at his knees.
"When the woman looked back he had turned onto his front and was in the press-up position on the pavement simulating sexual intercourse."
The incident ended when a neighbour arrived on the scene and took Marshall back home.
"He seems to have no recollection of this while being interviewed by police," said Mr Fraser.
"It is a regrettable incident resulting from a combination of alcohol and medical problems.
"He exposed himself to risk and no doubt caused upset to those who saw it."
Sheriff Kevin Drummond described the incident as "bizarre"
However, Marshall's lawyer successfully argued there was not a significant sexual aspect to the case.
As a result Sheriff Kevin Drummond decided not to place his name on the sex offenders' register although he described his behaviour as "bizarre".
Mark Harrower, defending, told the court that Marshall had an arthritis condition which required medication and had been drinking to excess.
"He does appear very ashamed about it and very shocked at his behaviour," he said.
Sheriff Drummond accepted that sex was not the main motivation of the incident.
"Anyone who lies on the road in the daylight, is significantly intoxicated and is partially undressed has a problem," he said.
"This was plainly a drunken episode in which you caused distress to members of the public but I accept your behaviour was not primarily sexually motivated.
"This may have been a drunken prank."
He said he did not consider the public needed to be protected from Marshall.
However, he warned him he had come close to being put on the sex offenders' register through his excessive use of alcohol.