The mother of three-year-old Mikaeel Kular has admitted killing her son and hiding his body in a suitcase, sparking a major search operation.
Mikaeel died two days after being beaten by Rosdeep Adekoya, 34, at the family's flat in Edinburgh in January.
She put his body in a suitcase, which she dumped behind her sister's house 20 miles away in Kirkcaldy, Fife.
However, she told police that Mikaeel had disappeared from her home, leading to a major two-day search.
Adekoya had originally been charged with murder, but admitted the reduced charge of culpable homicide when she appeared at the High Court in Edinburgh. Sentence was deferred until 25 August.
Adekoya, a prisoner at Cornton Vale jail near Stirling, admitted attempting to defeat the ends of justice by pretending to police that Mikaeel had gone missing.
She pleaded guilty to repeatedly punching her son and causing his body to hit against a hard object or inflicting blunt injuries on his head and body between 12 and 15 January at their home in Ferry Gait Crescent in the Drylaw area of the city.
She also admitted wrapping Mikaeel's body in a duvet cover, putting it in a suitcase and driving to Dunvegan Avenue in Kirkcaldy, Fife, where she hid the case under a bush in woods behind a house.
She had called 999 to report her son missing to police, telling officers he got out of bed and climbed on a stool to unlock the front door of his home.
She admitted causing a major search for her son, involving police, the fire service, coastguard, mountain rescue crews and members of the public.
The court heard that Adekoya's internet history had showed searches including "I find it hard to love my son", "I love all of my children except one", "Why am I so aggressive with my son" and "Get rid of bruises".
Advocate depute Alex Prentice said: "The basis for the plea tendered being accepted is that the Crown accepts that the accused had no intention to kill Mikaeel and that the assault perpetrated upon him, although severe, fell short of the wicked recklessness required for murder."
The court heard that Mikaeel died on the night of Tuesday 14 January from injuries inflicted the previous Sunday.
His mother "lost her temper" when he was repeatedly sick following a trip to a Nando's restaurant at the city's Fountain Park.
She smacked him and struck him on the body and head with a clenched fist, the court heard.
When Mikaeel was sick for a third time, she dragged him to the shower by his arms and "beat him heavily" on his back as he lay over the bath edge.
Mr Prentice said: "It's likely that the internal damage was inflicted during this last beating."
Over the next few days Mikaeel's condition worsened and he was kept off nursery. He was assaulted again on the Monday after being sick and became "listless".
His mother did not take him to a doctor because of the bruising, the court heard.
By Tuesday night, Mikaeel was said to be "quiet" and was giving a "limited" response to his mother's questions.
Mr Prentice said: "He would have been in significant pain but was put to bed.
"The pain would have increased significantly while Mikaeel became dangerously ill and finally dying as a result of the injuries inflicted upon him by the accused.
"It was during that night that he died.
"The accused discovered his body on the floor when wakening the children in the morning."
After discovering her son's body, Adekoya took his twin sister to nursery before driving straight to Fife.
Mr Prentice said: "At the time, it appears that the accused had placed Mikaeel's body in a suitcase and put him in the boot of her car."
Masts captured her mobile phone travelling from Edinburgh across the Forth Road Bridge.
During a police interview she broke down and told officers: "It was an accident and I panicked. I am going to go to the jail."
She was asked where Mikaeel was and replied: "In the woods behind my sister's house."
Adekoya then took police to her son's body in the woods, telling them he was "to the left under trees in a suitcase" which she had covered with branches.
Mr Prentice said Mikaeel's body was found inside the suitcase.
The final cause of death was found to be "blunt force abdominal trauma".
Mikaeel had more than 40 separate injuries to his body, including bruises to his back, chin and cheek, trauma to the brain, haemorrhage in the spinal cord and injuries to his arms.
Mr Prentice said: "If medical assistance had been called for death might not have resulted."
Assistant Chief Constable Malcolm Graham, of Police Scotland, said: "During the initial stages of the inquiry we appealed for information about Mikaeel's whereabouts as concern for him grew. The local community assisted us greatly in that search.
"What followed was an incredible level of support and assistance to one of the biggest missing person inquiries Police Scotland has undertaken.
"I would like to take this opportunity to sincerely thank the public for all of their help during the search efforts and the continued support provided to police and Mikaeel's family during the course of this investigation.
"Incidents such as this are thankfully extremely rare and I would like to assure the public that whenever we receive reports of concern for children we investigate the matter thoroughly and should any criminal offences be detected, then those responsible will be brought to justice."