A 20-year-old woman has been charged with human trafficking in South Africa after allegedly trying to sell her child for 5,000 rand ($380; £250) on advertising website Gumtree.
The woman was not asked to plead in the Pietermaritzburg magistrates court and will be held in custody until the case continues on 26 October.
She was arrested after an agent posed as a buyer, a police spokesman said.
The 19-month-old boy has been handed over to social workers.
"Someone alerted us to the advert. We made contact with the young lady and met with her undercover on Tuesday," Brigadier Hangwani Mulaudzi told the BBC.
"We had told her that we would make the cash transaction she asked for. We arrested her as soon as we met with her," he said.
After the woman was charged, the case was postponed to allow the police more time to investigate.
Gumtree has been co-operating with investigators, the police said.
Brig Mulaudzi said the initial advert was immediately red-flagged by Gumtree, and removed.
He said a second advert was then placed, with the heading: "baby car seat" and placed in the Baby and Kids sale section.