The boy - who police say had dozens of the needles stuck deep into his body by his stepfather in a bizarre ritual - was in intensive care following surgery but was doing well, said Suzy Moreno, a spokeswoman for Hospital Ana Nery in the northeastern city of Salvador.
"Doctors are confident he'll be strong enough to have another surgery on Monday to remove more needles," she said.
Police say 30-year-old bricklayer Roberto Carlos Magalhaes confessed to pushing the metal sewing needles into the 2-year-old child because his lover told him to while in trances. The rituals, performed over a month, were supposedly aimed at keeping the couple together.
The child underwent nearly five hours of surgery to remove the four needles, which were up to 2 inches (5 centimeters), Moreno said.
Dozens more needles remain inside the boy's body, but the four removed were considered the most life-threatening.
Police say they believe the lover, Angelina Ribeiro dos Santos, told Magalhaes the ritual would keep them together, but she was really seeking revenge on Magalhaes' wife by having him hurt her son.
The bricklayer told detectives that dos Santos would enter into trances and give him commands to insert the needles, police inspector Helder Fernandes Santana said. The stepfather told police the rituals happened every few days for a full month, with him inserting several needles during each session.
Dos Santos paid to have the needles blessed by a woman who practiced the Afro-Brazilian religion of Candomble, Santana said.
Authorities initially estimated the boy had as many as 50 needles inside him. After many test, doctors now believe he was struck with closer to 30 needles but they still don't know exactly how many.
"They haven't focused on how many there are because they are concentrating on the most dangerous ones," Moreno said.
Magalhaes and dos Santos were both arrested, though no charges have been filed.
Dos Santos is not believed to be a member of any religious or occult group, and authorities believe she came up with the idea on her own, Santana said.
The two were taken to an undisclosed location for their own protection after a mob threw stones at the police station where they were being held. It was not immediately clear whether they had legal representation.
Authorities also detained the woman who blessed the needles so she could be questioned, but Santana says he expects she will be released without charge because she did not know how the needles were being used.
The boy's mother, a maid, took him to her hometown hospital in Ibotirama on Dec. 10, saying he was complaining of pain.
After X-rays revealed the cause, the mother told police she didn't know how the needles got inside her son, whose name was not released because of his age. The boy was later transferred to the much larger hospital in Salvador.
Police and doctors concluded it would have been impossible for the boy to have ingested the needles, which have been found throughout his abdomen, in one leg and in his spine.
Afro-Brazilian religions practiced in Brazil have no ceremonies, rituals or practices involving harm to people, said Nelson Inocencio, director of African-Brazilian studies at the University of Brasilia.
He worried that the incident could hurt the image of the religions, of which Candomble is the most popular, concentrated in Bahia state where Ibotirama is located.
Associated Press Writers Alan Clendenning in Sao Paulo and Marco Sibaja in Brasilia, Brazil, contributed to this report.