SHANGHAI — Costco was forced to shut its first store in China early on its opening day on Tuesday, according to state media, after large crowds flocked through the door and caused neighborhood traffic jams.

Videos posted on Chinese social media showed thousands of people crowding the aisles of the store in Shanghai's Minhang district, while signs outside warned incoming shoppers that they might have to wait three hours to park.

One nearby school sent out an advisory to parents warning them about the traffic conditions. "Please expect the student dismissal this afternoon to be severely delayed due to the grand opening of Costco Supermarket," said the message.

People visit the first Costco outlet in China, on the stores opening day in Shanghai on Aug. 27, 2019. Hector Retamal / AFP - Getty Images

The Paper, a media outlet run by the Shanghai government, reported on social media at 2:43 p.m. that the store had shut early, citing the local district government.

"Due to the extremely large crowds at the newly opened supermarket, for the safety of the public we urge that residents consume in a rational manner and choose to go shopping at an off-peak time," it quoted government officials as saying.

Costco did not immediately respond to a Reuters' request for comment.

People visit the first Costco outlet in China, on the stores opening day in Shanghai on Aug. 27, 2019. Hector Retamal / AFP - Getty Images

Costco announced last month that it would open its first store in China. It first entered the country in 2014 through opening an online store on Alibaba Group Holding Ltd's Tmall online marketplace.

Its busy first day came as other big-name Western retailers such as Amazon, Tesco Plc and Carrefour, are retreating from China having struggled to win market share in the face of strong competition from domestic rivals.