Eden Woon, Starbucks' vice-president for Greater China, said: "There were several choices, one of which was to continue, but it would not carry the Starbucks name any more."
Starbucks was offered the option to revamp the outlet as a "coffee shop" selling domestic coffee and other beverages alongside its own brew, but decided it wanted to maintain its own brand.
"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," Woon said.
"We have always been in touch and on good terms. My understanding is the decision was amicable and not aimed at Starbucks."
A campaign for the closure of the Forbidden City outlet had been growing since Rui Chenggang, an anchor for China Central Television's English-language channel, complained earlier this year that the American chain's presence in the symbol of the Chinese nation was trampling on Chinese culture.
The outlet opened in 2000 at the invitation of palace managers, who needed to raise money to maintain the complex of villas and gardens.
But it prompted a media backlash so severe that the museum authorities considered revoking its lease after a couple of months.
It has operated without the usual outward corporate Starbucks bunting in recent years.
Not all visitors were pleased to see the back of the US chain.
"I don't have a problem with Starbucks, because all the other coffee shops here already make it kind of commercial," said Wu Haiying, who had travelled to Beijing to show the palace to her seven-year-old son.
"Why shouldn't we adopt Western things that are good?"
The Forbidden City is surrounded by a moat to the north of Tiananmen Square and has a fabled 9,999 rooms. It was listed by Unesco as a World Heritage Site in 1987.