The orange-sized growth was so large it was crushing Isabel Roberts's throat, leaving her unable to breathe naturally.
Doctors needed to rapidly fit a tube to help her breathing before she stopped getting oxygen from her mother.
The tumour has since been removed and doctors expect Isabel to make a full recovery.
Sometimes things go wrong during a baby's development in the womb and tumours can form. In 2012 surgeons in the US removed a tumour while the baby was still in the womb.
Doctors at Sheffield Children's Hospital and Jessops Maternity Hospital noticed an abnormal growth in a scan after 33 weeks.
The twins were delivered by Caesarean section and doctors then started a "race against time" as soon as Isabel's head was free.
Consultant anaesthetist Dr Ayman Eissa said: "We estimate the placenta will continue to supply oxygen through the cord for up to five minutes, but you can never be sure. It could break off at any time.
"The baby was so small and the tumour so big, it was a very difficult job to secure the airway."
While Isabel weighed 3lb 9oz (1.6kg), the tumour alone weighed 0.6lb (0.3kg).
"The relief when I secured the tube was unimaginable. It was definitely the most stressful few minutes of my career," Dr Eissa said.
Isabel's tumour was removed 10 days later.
She is now at home in Hoyland, near Barnsley, with her twin sister Alexandra, older sisters Sarah and Olivia and mother and father Maureen and Simon.
Mrs Roberts said: "The few weeks leading up to and after the twins' arrival were a blur. It's crazy to think just how much has happened to my baby. I can remember walking into the operating theatre to have the Caesarean and not knowing what was going to have happened when I woke up."
The consultant who removed the tumour, Neil Bateman, said: "When we weighed the tumour it accounted for one-sixth of her entire body weight.
"It is very rare for a baby to develop a tumour of this size in the womb."
The cancer did not spread, but Isabel is now on a course of chemotherapy. She is expected to make a full recovery and is "getting stronger every day".
A baby girl has been born in Sheffield with a huge tumour that accounted for a sixth of her body weight.