Media playback is unsupported on your device Media caption Shoppers jostled for roast chicken at China's first Costco store

US retailer Costco was forced to close early on its opening day in China, after the store was swamped with shoppers.

Buyers battled long queues and traffic chaos, before the Shanghai store was shut hours early due to "overcrowding".

Costco's push into China comes as other foreign retailers have struggled to compete with local rivals.

It also comes at a time of rising tensions between the US and China over trade.

Costco is a discount warehouse store that sells a range of goods, from fresh foods to household electronics.

Some customers spent two hours lining up to pay for their purchases, while some had to wait three hours for parking, state news agency Xinhua reported.

Image copyright AFP Image caption Images from the store show customers caught up in heavy crowds

One video showed people pushing through heavy crowds to get their hands on roast chickens.

"Due to overcrowding in the market, and in order to provide you with a better shopping experience, Costco will temporarily close on the afternoon of August 27. Please avoid coming," the retailer in a notice on its official app, according to AFP.

Image copyright Getty Images Image caption Some customers reportedly spent two hours lining up to pay for their goods

Costco has had an online presence in China since 2014, through a partnership with e-commerce giant Alibaba.

The firm's first store in the country comes as other international retailers battle tough competition in China.

Earlier this year, Amazon said it was downsizing its operations in China and France's Carrefour agreed to sell 80% of its China business to local retailer Suning.com after a series of losses.

Tesco has struggled to crack the Chinese market.

Costco's China move also comes at a difficult time for US-China relations.

The world's two largest economies have been fighting a trade war for the past year, and tensions have escalated with the threat of more tariffs from both sides.