BEIJING — Don't mess with China and its growing cadre of powerful luxury consumers.

Dolce & Gabbana learned that lesson the hard way when it faced a boycott after Chinese expressed outrage over what were seen as culturally insensitive videos promoting a major runway show in Shanghai and subsequent posts of insulting comments in a private Instagram chat.

The company blamed hackers for the anti-Chinese insults, but the explanation felt flat to many and the damage was done. The Milan designers canceled the Shanghai runway show, meant as a tribute to China, as their guest list of Asian celebrities quickly joined the protests.

Then, as retailers pulled their merchandise from shelves and powerful e-commerce sites deleted their wares, co-founders Domenico Dolce and Stefano Gabbana went on camera — dwarfed against the larger backdrop of an ornate red wall-covering — to apologize to the Chinese people.

"We will never forget this experience, and it will definitely never happen again," a solemn-looking Gabbana said in a video statement posted Friday on social media.

The apology video, and the sharp public backlash that demanded it, shows the importance of the Chinese market and the risks of operating in it. More broadly, it highlights the huge and still-growing influence of China, a country that cannot be ignored as it expands economically, militarily and diplomatically.

These trends are intertwined in frequent outbursts of nationalist sentiment among consumers who feel slighted by foreign brands or their governments. It's not the first time a company has apologized, and it surely won't be the last. Mercedes-Benz did so in February for featuring a quote by the Dalai Lama on its Instagram account.

For Dolce & Gabbana, it could be mark the end of its growth in China, a crucial market for global luxury brands that it has cultivated since opening its first store in 2005 and where it now has 44 boutiques.

"I think it is going to be impossible over the next couple of years for them to work in China," said Cary Cooper, a professor of organizational psychology and health at Manchester University in England. "When you break this kind of cultural codes, then you are in trouble. The brand is now damaged in China, and I think it will be damaged in China until there is lost memory about it."

London-based Brand Finance consultancy estimates that the scandal could wipe up to 20 percent off the Dolce & Gabbana brand's value of $937 million, which already places it out of the top 50 global apparel brands. They are 36th among all Italian brands, extending to sectors like automotive.

That could shake Dolce & Gabbana's financial health. The privately held company does not release its individual sales figures. But Chinese consumers are responsible for a third of all luxury spending around the globe, according to a recent study by Bain consultancy. That will grow to 46 percent of forecast sales of an estimated 365 billion euros ($412 billion) by 2025, fueled by millennials and the younger Generation Z set, who will make a growing percentage of their purchases online.

"Without China, the hinterland for growth, D&G will obviously be in a weak competitive position and in danger of being eliminated," the Chinese business magazine New Fortune said in a social media post Sunday. "This is one of the major reasons why D&G finally lowered its head. They really cannot survive without the Chinese market."

While Dolce & Gabbana has displayed a knack for social media engagement, inviting millennial influencers with millions of collective followers to sit in their front rows or walk in their shows, that engagement has been a double-edged sword. Pop idol Karry Wang, who has drawn hundreds of screaming Chinese fans to the designer's Milan showroom for season runway shows, was one of the first to disavow the brand, saying he was ending his role as Asia-Pacific brand ambassador.

Dolce found himself on the defensive several years ago after Elton John lashed out for comments that suggested he did not support gay couples using surrogate mothers to have children. At the time, more than 67,000 tweets urged #boycottdolcegabbana, while Courtney Love vowed to burn her Dolce & Gabbana garb and Martina Navratilova pledged to trash her D&G shirts.

Gabbana, who has 1.6 million Instagram followers, faced a more contained backlash earlier this year when he responded to a collage of Selena Gomez photos on Instagram with the comment, "She's really ugly."

Celebrities took to social media Wednesday to blast Dolce & Gabbana and said they would boycott the show, which was canceled. By Thursday, the company's goods had disappeared from major e-commerce websites. The prevailing sentiment was captured by an airport duty-free shop that posted a photo of its shelves emptied of D&G products: "We have to show our stance. We are proud to be Chinese."

The rapid escalation into a public relations disaster was fueled by social media. Individuals posted videos of themselves cutting up or burning their Dolce & Gabbana clothes, or picking them up with chopsticks and putting them in the trash. A parody of the offending Dolce & Gabbana videos, which featured a Chinese woman using chopsticks to eat pizza and an oversized cannoli, shows a white man trying to eat Chinese food with a fork and knife. At least three rap bands took up the cause with new songs.

"Companies that don't respect us don't deserve our respect," Wang Zixin, team leader of CD Rev, a nationalist rap band, said by phone from Chengdu, the capital of Sichuan province. Its new song had been viewed more than 850,000 times on Weibo.

"We hope people will remember companies that have ever insulted China, and not forget about them when the fallout passes," Wang said.

That sense of pride reflects a nationalism that has been encouraged by the government, often in disputes China has with other countries over other foreign products.

Sales by Japanese automakers plunged in 2012 amid tensions between islands both countries claim in the East China Sea. The clash also illustrated the complexity of Chinese sentiment: Industry analysts said buyers didn't want to be seen in Japanese auto showrooms but went ahead with planned purchases once tensions had passed.

More recently, several foreign companies ran afoul of Beijing's insistence that they explicitly refer to Taiwan, a self-governing territory, as part of China. Many complied, showing how important the Chinese market has become.

Delta, American and other airlines agreed to refer to Taiwan as part of China, and Zara now says "Taiwan, China" on its website after regulators criticized the fashion brand for calling Taiwan a country. Marriott announced it "respects and supports" China's sovereignty after it was ordered to shut its China website for a week.

Actor Richard Gere, a supporter of the Dalai Lama, has told The Hollywood Reporter that movie studios balk at hiring him for fear of an official or public backlash that might affect ticket sales in China.

It remains unclear whether the D&G mea culpa video will stop the backlash — or if it will have implications for Made-in-Italy at large. The scandal erupted as Italy's high-end furniture and design companies were making an annual presentation in Shanghai and as Miu Miu, the Prada Group's little sister line, showed its cruise line in Shanghai.

Italian designers have so far refrained from comment. Dolce & Gabbana has remained conspicuously outside of the Italian Fashion Chamber, which organizes fashion weeks and acts as a lobby for the fashion industry.

Brand Finance's luxury expert, Alex Haigh, said the scale of the Chinese reaction risked contagion in other markets, but that the brand could get ahead of the scandal if it makes sincere change. "They have made a big storm for themselves," he said. "They need to wait a few months, and potentially do something like Volkswagen, when it had the emission scandal and repositioned itself as a more environmentally friendly electric-vehicle-first brand. Sometimes these issues can be a focal point for change."

Italian commentators mused whether the Dolce & Gabbana protests were truly spontaneous or if there was some level of government control behind them. The government has publicly said the spat had no diplomatic element and would not comment.

"Anywhere in the world, an entrepreneur can make a mistake, use inappropriate language. Usually it is the consumers and the market to decide the seriousness of the offense," the Milan daily Corriere della Sera wrote in a commentary. "Only in China is one forced to produce a humiliating video with public self-criticism, like in the time of Mao's revolution. Now China feels powerful and is applying re-education on a global scale."

Follow NBC Asian America on Facebook, Twitter, Instagram and Tumblr.