An advertisement placed on the homepage of Taobao – a subsidiary of the Alibaba Group – shows an image of a pregnant woman, with the text: what to do if you’re pregnant with a girl?
The second line encourages women to use the product known as 'Jianyunbao' for their next pregnancy.
The product name roughly translates to ‘alkaline elixir for pregnancy’, and claims it can adjust a woman’s pH levels to increase her chances of having a male baby.
Another advertisement says the product is made from Australian spirulina, and if a woman takes the supplement every day, "the dream becomes easy".
In a statement posted on the Chinese social media platform Weibo, Alibaba said they have removed the advertisement from all its sites and penalised the company for violating seller rules.
“This was a mistake in our work, and we sincerely apologise,” the statement said.
The company also thanked discerning netizens for spotting the advertisement, which the statement described as "sexist".
The advertisement was lambasted across Chinese social media, with many condemning the advertisement’s insinuation that a female child was lesser than a male.
An article by the All-China Women’s Federation, a government-aligned group, slammed the website for putting what it called a discriminatory advertisement on its front page.
According to the National Bureau of Statistics of China, at the end of 2017, China had 32.66 million more males than females.
China's National Health and Family Planning Commission admitted the demographic disparity is a major problem for the country.
"Our country has the most serious gender imbalance that is most prolonged and affecting the most number of people," the National Health and Family Planning Commission said in a 2015 statement on its website.
In 1994, the Chinese government banned sex-screening of fetuses, but as the gender gap demonstrates, parental preference for male children continues to manifest in some parts of Chinese society.
Alibaba said it will adjust its review system for product listings, to ensure similar advertisements are not displayed in the future.