A drug supplier was tracked down by a teenager’s dad on Facebook after the girl was found unconscious in the street.
The 23-year-old suspect, Marc Barron, offered the 14-year-old schoolgirl and her friend ecstasy in a flat in Post Glasgow.
Later, the girl was found passed out on a nearby footpath and rushed to hospital.
The next day the girl was quizzed by her father and she told him what had happened. He then found Barron on Facebook and sent him a private message.
They arranged to meet in a supermarket car park where the 23-year-old apologised for what had happened.
Both men then went to a police station, where Barron pleaded guilty to supplying the Class A drug to two 14-year-olds.
His sentenced has been deferred until 27 June for an updated criminal justice and social work report.