The makers of the new film Peter Rabbit have apologised after being accused of insensitively depicting a character's allergy.

The scene in question shows a character with an allergy to blackberries being hit with the fruit by a group of rabbits.

Sony Pictures said in a joint statement with the filmmakers that "food allergies are a serious issue" and the film "should not have made light" of a character being allergic to blackberries "even in a cartoonish, slapstick way".

The charity Kids with Food Allergies condemned the film on social media, prompting some Twitter users to adopt the hashtag #boycottpeterrabbit.

In a Facebook post the group said that "food allergy jokes are harmful to our community" and that making light of the condition "encourages the public not to take the risk of allergic reactions seriously".

Some people criticised the backlash, with one person tweeting: "Just read this drivel today, #boycottpeterrabbit people getting offended over kids films. I remember violent cartoons as a child and I don't recall brutally killing anyone growing up."

Another tweeted that the scene teaches children that violence is wrong.

The controversial scene shows the character Mr McGregor, who is allergic to blackberries, being forced to use an EpiPen after Peter Rabbit and his friends throw the fruit at him.

The studio and filmmakers said that they "sincerely regret not being more aware and sensitive to this issue, and we truly apologise".

The film was released in US cinemas this weekend and is an adaptation of Beatrix Potter's book Peter Rabbit.