Image copyright EPA Image caption Premier Jiang Yi-huah signed the resignation order but urged the cabinet to continue working

Taiwan's entire cabinet has resigned after the ruling Kuomintang (KMT) suffered its biggest ever defeat in local elections on Saturday.

The KMT lost control of districts across the country, including the mayor's office in the capital, Taipei.

On Saturday, Prime Minister Jiang Yi-huah stood down, saying he took responsibility for the defeat.

The election was widely seen as a rejection of the KMT's policy of pursuing closer ties with Beijing.

China and Taiwan have been ruled separately since the end of a civil war in 1949, with China viewing it as a renegade province.

The BBC's Cindy Sui in Taipei said while many feel the KMT's trade deals with China have brought benefits to Taiwan, there is a sense that ordinary people have not benefitted.

There are also concerns that the island is becoming too economically dependent on its powerful neighbour, which could ultimately hurt Taiwanese independence, our correspondent adds.

Taiwan's 81 cabinet members will now serve in caretaker roles until a new premier is appointed to choose their replacements.

After signing the resignation order, Mr Jiang urged ministers to continue carrying out your roles until the new cabinet is formed. Hopefully the period won't last too long."

On Saturday, President Ma Ying-jeou apologised to KMT supporters "for making everyone disappointed".

"I've received the message people have sent via these elections," he told a news conference. "It's my responsibility and I will quickly offer a party reform."

There is widespread speculation that Mr Ma will step down as KMT chairman in the coming days.

More than 18 million eligible voters were registered to vote in Saturday's election, choosing from among 20,000 candidates who were running for more than 11,000 positions.