Dr. Luiz Cesar Soltoski said that surgeons hope to remove most of the needles - some as long as 2 inches (5 centimetres) - but those in the lungs will have to wait until the child's breathing improves.
Some needles cannot be removed as they are too close to vital organs or even inside organs, Soltoski said.
The boy's mother, a maid, took him to a hospital in the small north-eastern city of Ibotirama last Thursday, saying he was complaining of pain. Three days later, after X-rays revealed many of the needles, doctors moved him to a larger hospital in the nearby city of Barreiras.
The mother told police she didn't know how the needles got inside her son, whose name was not released because of his age. But police Wednesday night detained an ex-stepfather of the boy who confessed, according to Brazil's Globo TV. It reported the man said he inserted the needles with the help of two women who were not identified.
The boy's father, Gessivaldo Alves, earlier told the newspaper A Tarde that he believed his son could have been a victim of a black magic ritual. Alves said he visited the home where the boy was living and found unspecified items that could be used for black magic, A Tarde reported.
The police inspector in charge of the case, Helder Fernandes Santana, told the Agencia Estado news agency that a black magic ritual involving the boy was among the motives that police were pursuing and that officers were casting a wide net for suspects.
"In theory, anyone who had a relationship with the boy is a suspect," Santana said. "All of our officers are focused on this case, gathering information."
Santana did not answer his cell phone Wednesday night to comment on the Globo TV report about the detention and confession of the ex-stepfather. No one answered the phone at the police station in Ibotirama.
The boy's doctor said he believed the needles were stuck into the child's body one by one.
"We think it could have only been by penetration because we found needles in the lung, the left leg and in different parts of the thorax. It couldn't have been by ingestion," Soltoski said.
Doctors found no signs of outside wounds on the boy. X-ray images carried by Brazilian Web sites clearly showed some of the needles inside his body.