A sample from the baby's umbilical cord analysed at the Hospital Son Espases in Mallorca confirmed that he had developed antibodies against Covid-19, Spanish media reported.
Manuel Grandal Martin, deputy director of the Madrid Hospital Directorate, said on Friday that the protection that the baby has is equal to that of someone who has been vaccinated, the Xinhua news agency reported.
"At the moment, he is perfectly protected, but it is not yet known how long it will last," said Grandal.
The case of the infant, named Bruno, is part of a study on the impact of Covid-19 on pregnant women. The study monitors 88 pregnant women who have caught Covid-19 during pregnancy, including those who are asymptomatic.
Other specialists believe this result opens the doors to the possibility of vaccinating pregnant women to immunise both themselves and their babies, who receive the antibodies through placenta.
Grandal explained there has so far been a lack of information about the effects of the vaccine on pregnant women, although there is no evidence that doing so is harmful.