POLICE have vowed to investigate potentially illegal online comments concerning the death of three-year-old Mikaeel Kular.
The Crown Office has warned that any criminal conduct on sites such as Twitter and Facebook will result in prosecution.
It comes after the arrest of two men over posts made on social media sites.
The boy's mother Rosdeep Kular, 33, is due to appear in court today charged in connection with her son's death.
She was detained by police on Friday night after Mikaeel's body was found in woodland near his aunt's house in Kirkcaldy, Fife, more than 30 miles from his Edinburgh home.
Ms Kular, a mother of five children, was arrested and charged on Saturday and is due to appear at Edinburgh Sheriff Court today. It has not yet been confirmed what charge she faces.
The search for the three-year-old, who was initially reported by his mother to have vanished from their home overnight, involved hundreds of volunteers from the local community.
The arrest of Ms Kular led to an outpouring of fury on some social media sites, with some people using strong language to make their feelings known.
However, the Crown Office warned that it would take a hard line with any people who broke the law on social media networks.
Individuals could breach contempt of court laws or defamation by commenting on the case. Even retweeting somebody's else's abusive post would put someone at risk of breaking the law.
A Crown Office spokeswoman said: "We will continue to work with Police Scotland to investigate any criminality arising from conduct on social media, and we will prosecute wherever there is sufficient evidence and it is in the public interest to do so."
The two men who have been arrested, aged 19 and 26 and both based in England, made comments on Twitter, police said. Both were questioned and released on bail yesterday.
Scottish officers worked with colleagues from Hampshire Constabulary and Derbyshire Constabulary to identify them.
Chief Superintendent Mark Williams, Police Scotland's Edinburgh Divisional Commander, said: "Any reports of racist, offensive or abusive comments made online will be thoroughly investigated and those responsible will be brought to justice. If you commit an offence, we will investigate it and you will be prosecuted."
Derbyshire Police said they had assisted colleagues at Police Scotland by arresting a man on suspicion of him sending offensive tweets.
A spokesman said: "Officers arrested the 26-year-old Heanor man this morning on suspicion of committing a racially aggravated public order offence.
"Members of the public in Edinburgh had complained about the content of some Twitter messages linked to the disappearance of three-year-old Mikaeel Kular.
"The man was questioned and released on police bail while the Crown Prosecution Service considers the case."
A major police investigation was launched to find Mikaeel after he was reported missing from his home in Edinburgh's Ferry Gait Crescent last Thursday.
More than 200 members of the public joined police and other agencies in their searches for the youngster in the Drylaw area of the capital on Friday.
Officers searching for the three-year-old found remains - now identified as those of Mikaeel - in Kirkcaldy, Fife, shortly before midnight.
Investigators have cordoned off and are examining a bungalow in Dunvegan Avenue in the town.
A wooded area to the rear of the property was also sealed off. It was reported that Ms Kular and her five children lived at the house until 18 months ago.
Reports yesterday suggested that Mikaeel was last seen at his nursery in December.
Hundreds of floral tributes, cards, flowers and cuddly toys have been placed near the flat where Mikaeel lived and the Fife property where he was found.
Ms Kular told police that she put her son to bed at her Edinburgh home at 9pm on Wednesday, but when she went to wake him at 7.15am the following day he was missing.
She also said that on the night he allegedly disappeared he was sleeping alone in the bedroom he normally shared with his twin sister Ashika.