The Starbucks outlet has been in the Forbidden City since 2000

An online campaign arguing that the shop was trampling on Chinese culture had drawn more than 500,000 signatures.

The Starbucks branch was told it could stay open if it sold other brands but has declined.

The Forbidden City was built in 1420 and was home to 24 emperors until the end of imperial rule in 1911.

It attracted nearly nine million visitors last year, is China's top tourist attraction and a Unesco World Heritage site.

Seattle-based Starbucks said the decision was "very congenial" and it respected the site's motives.

Starbucks's vice-president for Greater China Eden Woon said: "There were several choices, one of which was to continue, but it would not carry the Starbucks name any more.

"We decided at the end that it is not our custom worldwide to have stores that have any other name, so therefore we decided the choice would be to leave."

'Solemnity undermined'

Starbucks, which has nearly 200 outlets in China, opened the Forbidden City shop seven years ago and removed its brand sign two years ago to address cultural sensitivities.

But the shop continued to draw protests.

China state TV personality Rui Chenggang led the online campaign, saying the shop's presence "undermined the solemnity of the Forbidden City and trampled on Chinese culture".

The palace is undergoing restoration that includes toning down the commercial aspect. The number of shops has already more than halved.