Hong Kong(CNN Business) Costco has built a cult following in the United States — now it's China's turn. The country's first Costco store is so popular that it had to shut down early on its first day because of too many shoppers.

The retailer opened its first physical outlet in Shanghai on Tuesday morning, and it quickly got too crowded to stay open.

"The store has been clogged up with crowds," Costco said in a text message alert to its members in China. "To provide you with better shopping experience, Costco will suspend business in the afternoon. Please don't come."

Costco's first store in Shanghai opened to massive crowds on Tuesday.

Police were deployed to restore order and manage traffic jams around the store, with law enforcement urging people to remain calm.

"For your safety, we hope citizens who want to go to Costco can maintain a rational attitude about consumption and avoid going out during rush hours. Those who have already gone there, you must follow orders," the Shanghai police said in a statement on its verified account on Chinese social network Weibo.

The photos posted by police with the statement included one of a sign Costco put up outside the store, which read: "The parking lot is full. It takes three hours to wait."

The company even issued an apology on social media for Chinese customers Wednesday, adding that it will put a cap on the number of customers allowed in the store to 2,000 and work with local police to "lessen the disturbance" to its neighbors.

The road ahead

While Costco has had an online presence in China for five years through a partnership with Chinese e-commerce firm Alibaba (BABA), the new brick-and-mortar store in Shanghai marks a significant investment.

Costco's annual membership program, which accounts for the bulk of its profit, is also cheaper in China — it costs 299 yuan ($42) compared to $60 in the United States.

But despite the early buzz around its Shanghai store, the US retailer will have to prove it can stick around for the long haul. It has to contend not only with global rivals like Walmart (WMT) and big Chinese players like Alibaba and JD.com, but also with China's rapid economic changes and its growing online retail industry.

"There is big market potential for Costco in China, as its value for money strategy is attractive to many middle-class consumers," said Michelle Huang, an analyst at Rabobank in Shanghai.

"Whether Costco can succeed in the long term depends how well it can adapt to China's dynamic retail landscape," she added.

Day one hype

While there are challenges on the horizon, the early hype around China's Costco stores is very real.

Echo Zhou, a 28-year-old financial professional in Shanghai, said she arrived at 9:10 a.m., but didn't make it to the parking lot until an hour later and finally got into the store around 11 a.m.

"The surrounding roads were paralyzed. The highway nearby was also congested," she said.

"By the time I got in, there were crowds of old people who had already wiped out some shelves."

Zhou said she decided to leave without buying anything as there was little room for shoppers inside the store, which was packed with crowds and the big shopping carts.

"I will give it another chance three months later as I've got the membership," she added.