The toddler was airlifted to a specialist cardiac unit in Salvador
Doctors in Brazil have removed four needles from the lung and near the heart of a boy who was reportedly subjected to black magic.
A hospital spokeswoman said the boy, 2, was in a stable condition but more operations would be needed to remove dozens more needles still inside him.
The four needles removed were thought to be the most threatening to his life.
His stepfather confessed to inserting the needles after being advised to perform a ritual killing.
The surgery lasted nearly five hours, said Susy Moreno, a spokeswoman for the hospital in the north-eastern city of Salvador where the boy is in intensive care.
"He's okay, the surgery was a success, he's doing fine," she told The Associated Press by telephone.
Earlier, the hospital said one needle had punctured the boy's heart, two were near the heart and a fourth was inside a lung.
Doctors had warned there was a further risk of infection and the operation itself could pose a risk of death.
Brazilian police said the stepfather had confessed to sticking the needles into the toddler with the help of another man and a woman.
X-rays showed up to 40 sewing needles inside the boy
Roberto Carlos Magalhaes told them his mistress had told him to ritually kill the child to take revenge on his wife, police said.
The boy's mother had taken him to hospital in the north-eastern state of Bahia, suffering from stomach pains and vomiting.
It was then that X-rays showed scores of sewing needles inside his neck, torso and legs.
The youngster was airlifted to Salvador for the operation.
The boy's mother told police she suspected the child had been the victim of a black magic ritual after she found suspicious objects in the home she shared with Mr Magalhaes - her husband of six months - and her six children.