TAIPEI, Aug 17 (Reuters) - Taiwan would not collapse like Afghanistan in the event of an attack, Premier Su Tseng-chang said on Tuesday, offering an indirect warning to powerful neighbour China not to be "deluded" into thinking it could take the island.

China, which claims democratically governed Taiwan as its own territory, has been ramping up military and diplomatic pressure to force Taipei into accepting Chinese sovereignty, causing concern in Washington and other Western capitals.

The defeat of the Afghan government after the withdrawal of U.S. forces and flight of the president has sparked discussion in Taiwan about what would happen in the event of a Chinese invasion, and whether the United States would help defend Taiwan.

Asked whether the president or premier would flee if "the enemy was at the gates" like in Afghanistan, Su said people had feared neither arrest nor death when Taiwan was a dictatorship under martial law.

"Today, there are powerful countries that want to swallow up Taiwan using force, and likewise we are also not afraid of being killed or imprisoned," he said. "We must guard this country and this land, and not be like certain people who always talk up the enemy's prestige and talk down our resolve."