Roberto Carlos Magalhaes said Sunday that he drugged the boy with wine and had his lover hold the child down while he pierced him.
"I did this two or three times a week during one month," the 30-year-old bricklayer told Globo TV's "Fantastico" program in a telephone interview from a jail in the northeastern state of Bahia.
The boy was too drunk from the wine mixture to cry while the needles were being pushed in, but he felt pain after the alcohol wore off, Magalhaes said.
"It was truly an unbearable suffering," he said. "It was to get back at the boy's mother. I thought the needles would work their way through his body and kill the boy. It was a way to kill without anyone discovering."
But the pain led the toddler to complain to his mother, and on Dec. 10 she took him to a hospital where X-rays revealed about 30 needles lodged throughout his body.
The boy is recovering well from a five-hour operation Friday to remove four rusty needles that were near his heart and in his lungs.
Doctors said they will try to remove three needles from the boy's abdominal region on Wednesday. He is expected to undergo a third surgery in the near future at the Ana Nery hospital where he is being treated in the northeastern city of Salvador, said hospital spokeswoman Susy Moreno.
Hundreds of people across Brazil had contacted the facility to inquire about the boy, Moreno said.
"Many people are coming by to bring Christmas presents," she said. "Many are also calling us to express their outrage. ... The support has been incredible."
Along with Magalhaes, police believe his lover, Angelina Ribeiro dos Santos, was also seeking revenge on Magalhaes' wife.
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.
Magalhaes and dos Santos were both arrested, though no charges had been filed. They were taken to an undisclosed location for their own protection after a mob threw stones at the police station where they were being held.
Dos Santos is not believed to be a member of any religious or occult group, and authorities believe the pair came up with the idea on their own.
The boy's name is not being released because of his age.
Local media reported Monday that another 2-year-old boy was being treated in the northern state of Maranhao after having nine needles found in his body. Police were investigating the circumstances of the case.