Green MSP Robin Harper said the legislation “clearly isn’t working”, and demanded that the Scottish Government mount an investigation.

Figures obtained by Mr Harper showed that between 2005 and 2008, only four adults were taken to court under the Protection of Children and Prevention of Sexual Offences (Scotland) Act.

One of the aims of the legislation - which was passed by the Scottish Parliament in 2005 - was to make it easier to prosecute paedophiles who groom children for sex.

And all four of the prosecutions that have taken place were under this section of the law, with three people given custodial sentences after being convicted and one person acquitted.

Mr Harper, a Lothians MSP, said: “The Scottish Parliament unanimously voted for the Protection of Children and Prevention of Sexual Offences Act in 2005 in the hope that it would help tackle the sexual exploitation of children and young people in Scotland by predatory adults.

“Given that there have only been four prosecutions under the Act, it clearly isn’t working.”

He demanded: “The Scottish Government must investigate why the legislation is proving so ineffective, and take urgent action to keep our children safe.”

Martin Crewe, director of Barnardo’s Scotland, also called for action from the Government.

Last month, the children’s charity hit out at the lack of specialist services to deal with the sexual exploitation of youngsters.

Mr Crewe said today: “We know children in Scotland are being sexually exploited, and we are seeing more and more organised exploitation. This Act should be being used to bring the exploiters to justice.”

He continued: “We recognise that conviction rates for sexual offences are low across the board and that this is a complex legislative area, but that should not be an excuse for inaction.

“We need Scottish Government action to assess the scale of the problem of organised sexual exploitation of children through prostitution or pornography, and to find out how to get the legislation working more effectively.”

However, a Scottish Government spokesman said the figures for convictions under the Protection of Children and Prevention of Sexual Offences Act could not be taken in isolation.

He said: “The organised sexual abuse and exploitation of children is covered by a number of common law and statutory offences. In the past year alone, 234 people were convicted of sexual offences against children in Scottish courts.”

The spokesman continued: “Children are among the most vulnerable members of our community. They and their families need and deserve the greatest protection our society can give.

“The Scottish Government, the police and prosecution service attach the highest priority to child protection.”

As well as the 234 convictions for sexual offences against children in 2007/08, there were 252 such convictions in 2006/07.