US Speaker Nancy Pelosi has left Taiwan after a brief but controversial visit.
Ms Pelosi - the most senior US politician to visit in 25 years - departed on Wednesday after meeting leaders in the capital Taipei.
But her visit, as part of a wider Asian tour, sparked fury in Beijing after she ignored its warnings not to travel to the island.
Taiwan is self-ruled - but China sees it as a breakaway province that will eventually unite with it.
Accusing the US of "violating China's sovereignty under the guise of so-called democracy", Chinese Foreign Minister Wang Yi said: "Those who play with fire will not come to a good end and those who offend China will be punished."
In a statement following the visit, Ms Pelosi said China cannot "prevent world leaders or anyone from traveling to Taiwan to pay respect to its flourishing democracy, to highlight its many successes and to reaffirm our commitment to continued collaboration".
The senior US Democrat's visit was not approved by her party colleague, President Joe Biden, who had said the American military felt it was "not a good idea right now" amid heightened tensions between the two countries.
The US walks a diplomatic tightrope with its Taiwan policy. On the one hand, it abides by the "One China" policy, which recognises only one Chinese government, giving it formal ties with Beijing and not Taiwan.
On the other, it maintains a "robust unofficial" relationship with the island, which includes selling weapons for Taiwan to defend itself.
As speaker of the US House of Representatives, Ms Pelosi is second in line to the US presidency, behind Vice-President Kamala Harris.
In response to the trip, China announced what it called "necessary and just" military drills in seas around 10 miles (16km) from Taiwan.
The exercises - which will begin on Thursday and last for five days - will take place in some of the world's busiest waterways and will include "long-range live ammunition shooting".
China's defence ministry has admitted that some exercises may breach Taiwan's territorial waters. In recent days, Chinese warplanes ventured as far as the median line, the unofficial divide separating China and Taiwan in the waters between them.
Taiwan has asked ships to find alternative routes to avoid the drills and is negotiating with neighbouring Japan and the Philippines to find alternative aviation routes.
President Tsai Ing-wen said the country was facing "deliberately heightened military threats".
In an effort to calm the situation, the foreign ministers from the G7 nations - Canada, France, Germany, Italy, Japan, the UK and US - released a joint statement saying China's escalation risked destabilising the region.
"There is no justification to use a visit as pretext for aggressive military activity in the Taiwan Strait. It is normal and routine for legislators from our countries to travel internationally," the statement said.
Taiwan's Pelosi love-in
Analysis by Rupert Wingfield-Hayes, BBC News, Taipei
There is a full-on Pelosi lovefest happening in Taiwan's capital, Taipei.
You can see it in the excited way Nancy Pelosi's arrival here is being reported on Taiwan's many TV news channels.
They have been studying everything from the colour of her outfits to the height of her heels, (very high for an 82-year-old apparently) and the fact that she "looked like Audrey Hepburn in that photo of her with President John F. Kennedy back in 1961".
Crowds gathered early outside Taiwan's parliament on Wednesday, hoping to get a glimpse of Ms Pelosi as she came out.
Almost everyone there brushed off worries that China might retaliate.
"China is bluffing," said a 70-year-old man. "It may retaliate in the short term, but if Beijing over-reacts, it will be punished by the United States."
"China shouldn't bully Taiwan like this" a 50-year-old house wife told us. "This trip is normal... if China continues like this it will only alienate more countries."
But to China this trip is anything but normal. To Beijing it is an outrageous breach of diplomatic norms.
During a meeting with Ms Tsai, Ms Pelosi praised Taiwan as "inspiration to all freedom-loving people" .
"Forty three years ago, America made a promise to always stand with Taiwan... today our delegation came to Taiwan to make it unequivocally clear we will not abandon our commitment to Taiwan," she said.
While the top Democrat's visit has been welcomed in Taiwan, it has somewhat split opinion in the US.
Some commentators speculated that the visit could even push China to supply arms to Russia for use in Ukraine - something it has so far refused to do.
But she has received support from some perhaps unexpected quarters, with 26 Republican senators writing a letter in support of the visit.
The letter, whose signatories included Senate minority leader Mitch McConnell, said that "for decades, members of the United States Congress, including previous Speakers of the House, have travelled to Taiwan".
The trip, it added, was "consistent with the United States' One China policy to which we are committed".
China and Taiwan: The basics
- Why do China and Taiwan have poor relations? China sees the self-ruled island as a part of its territory and insists it should be unified with the mainland, by force if necessary
- How is Taiwan governed? The island has its own constitution, democratically elected leaders, and about 300,000 active troops in its armed forces
- Who recognises Taiwan? Only a few countries recognise Taiwan. Most recognise the Chinese government in Beijing instead. The US has no official ties with Taiwan but does have a law which requires it to provide the island with the means to defend itself.
Additional reporting by Tiffany Wertheimer