Karen McCarter, headteacher Norbreck Primary Academy in Blackpool, said she didn't want to be a "killjoy" but the school couldn't take the risk of giving children a cake when they couldn't account for the ingredients.
The letter sent to parents read: "We have decided that it is no longer possible for children to bring birthday cakes to school.
"There are many reasons for this, some of them serious. As we are not able to account for the ingredients in the cake, we could therefore unknowingly give a product to a child to which they are allergic."
The note continued: "Even if we had a list of ingredients, in a busy school day, it is too much to expect teachers to read ingredient lists and then decide who can and who cannot eat the product.
"Any cakes sent into school for birthdays or other reasons will be sent home uneaten.
"I appreciate that this is sad, but in our modern society in which we are held accountable, we cannot take the risk. Many thanks for your understanding and compliance with this."
McCarter explained at least 10 of the 610 pupils at the school had previously felt left out due to not being able to eat a birthday cake.
She said it was also hard to know where the cakes were made and if it was in line with the school's healthy eating initiatives.
In a statement sent to HuffPost UK Parents, she wrote: "Historically birthdays cakes were brought into school on a very rare occasion, once or twice a year, but now it is happening on such a regular basis that it is disrupting the school day.
"I am sure that parents appreciate that a teacher’s time is best spent educating their children rather than cutting up cake, handing it out and cleaning up afterwards.
"Also as many cakes are homemade the ingredients are unknown which could potentially lead to problems for children with allergies.
"All children are made to feel special when it is their birthday and the class teachers ensure that all birthdays are remembered and celebrated. The birthday cake is something to share outside of school with family or with friends at a party, like it always has been.
"I have asked parents not to send their children to school with cakes in the future and no-one has been in touch to express any concern about the decision."
Blackpool council confirmed that no parents have lodged any official complaints regarding the birthday cake announcement.
"Birthday cakes at school are great fun and a great tradition," she told HuffPost UK Parents.
"However, I know a number of teachers, and they are stretched to capacity, while being more accountable than ever - so this is no surprise."
Siobhan Freegard founder of Channel Mum also believes this is a valid choice.
She explained: "The school aren’t trying to spoil children’s birthdays but simply to keep all their pupils safe.
"They have a duty of care to children while on school property and that means looking after those pupils that suffer from food allergies. Some conditions are potentially fatal - and you would not want to risk a serious incident simply for a slice of cake."
Freegard noted this rule is becoming more common in many schools as food allergies rise.
She added: "Instead of cake, schools now tend to allow younger pupils to celebrate by bringing in stickers or party favours, or in the infants, by wearing a party hat or crown.
"This still allows children to feel special without putting anyone at risk or excluding them as they can’t eat the treats on offer."
Aby Hawker, 40, PR consultant at Falcon PR, and mum to Olivia, nine, and Harry, seven added: "My genuine feeling is that kids with allergies have to be aware of what they can and can't eat so they can make others aware and avoid foods that can cause them to react.
"In life there will be cake. Knowing how to deal with the fact that you can't have a slice is no bad thing."
Cllr Tony Williams told The Guardian: "To be left out because you are allergic is a little bit cruel. I understand why the school is doing this because it’s very difficult to take cake to school to share and leave children feeling left out.
"I have never known it to be a problem anywhere else, but if the school has children who are allergic then it’s common sense."