"It's rare to successfully maintain a pregnancy for so long, that it is at such an early stage, at 17 or 18 weeks," said Barbara Krolak-Olejnik, head of the neonatal unit at the University Hospital in the southern city of Wroclaw.
The 41-year-old mother was rushed to hospital by ambulance late last year and deemed brain dead due to brain cancer.
"Her whole family wanted us to try to save the child," Krolak-Olejnik told AFP, adding that the baby boy was born in January in the 26th week of pregnancy.
The baby weighed just one kilogram (2.2 pounds) at birth, but is now up to three kilograms after three months of intensive care and has just left hospital showing "no complications".
"But we have to be patient and wait and see how he grows," Krolak-Olejnik said, adding that the baby was being bottle-fed and breathing on his own.
The mother's life-support system was turned off hours after the birth.