The woman turned herself in to state prosecutors after the murder in the city’s Gotthelf neighbourhood.
She did not know her victim or his family, prosecutors in Basel-Stadt said in a statement on Friday.
Forensic investigations revealed she killed the boy with a serious knife injury to the neck.
The motive for the murder is not known.
The 75-year-old woman, a Swiss national, is currently being held in investigative custody but there doubts about her legal culpability, prosecutors said. She is undergoing psychiatric evaluation.
Die Trauer und Anteilnahme am Tatort zwischen Häuserzeilen und Bäumen auf dem Trottoir ist gross. https://t.co/DeEtRUUK0D
— Basler Zeitung (@bazonline) March 22, 2019
The family of the murdered seven-year-old boy was from Kosovo and he is to be buried there after his body is released by investigators, Swiss media reported.
The boy’s murder has shocked the local community in Basel and captured headlines across Switzerland.
The child was attacked while he was walking alone home from school at around 12:30 pm on Thursday.
The boy's teacher found him lying on the ground in a serious condition and called for an ambulance. Despite efforts to resuscitate him, he was declared dead at the hospital, police said.
Flowers and candles have been placed at the spot where he was killed.