The Swiss food giant Nestlé has cancelled an online publicity campaign in Morocco after it was branded sexist on social media.

The mini-series, titled I Want to Get Married, featured five young women competing to win a husband by impressing his mother.

The first episode saw the would-be brides asked to make a dessert using Nestlé condensed milk.

Nestlé says it "sincerely regrets" that the content offended some viewers.

A number of Moroccans had lambasted the campaign, saying it was degrading and outdated to pick a wife based on her cooking skills.

Some used the hashtag "shame on Nestlé", saying Morocco's women deserved better.

Historian Samia Errazzouki, who was previously a Morocco-based journalist, tweeted a clip from the series.

She also highlighted a description of the adverts given in a video by Nestlé's local brand manager, who said the firm had deliberately chosen a stereotypical approach that could be "interpreted in different ways", calling it "a subject to debate, and funny".

Nestlé said in a statement that it had not meant to cause offence, but "upon review we have decided to end our Baghi Ntzewej [I Want to Get Married] campaign in Morocco with immediate effect".

The company said it was "strongly committed to equality and diversity, and to treating everyone with respect", and that its advertising "should always live up to these values".