China warned Washington not to "play with fire" on Wednesday as a US delegation wrapped up a historic trip to the self-ruled island of Taiwan. Beijing has been infuriated by the highest-profile visit in decades to Taiwan, which it sees as part of its territory, as US-China relations plunge to a record low over a range of issues from trade to military and the coronavirus pandemic. Health chief Alex Azar finished a three-day visit to Taiwan, during which he criticised China's handling of the pandemic and visited the shrine of a former Taiwan president hated by the Communist Party leadership. Beijing slammed the visit Wednesday and said it "firmly opposes official exchanges between the US and Taiwan under any pretext". "On issues involving China's core interests, some people in the US must not harbour illusions, those who play with fire will get burned," said foreign ministry spokesman Zhao Lijian at a regular press briefing. "I would also like to remind the Taiwan authorities not to be... subservient to others, to rely on the support of foreigners, and to be bent on pursuing independence, which is a dead end," Mr Zhao said. Beijing insists that Taiwan - which has been self-ruled since 1949 - is part of "one China" and has vowed to react with force if it ever formally declares independence. On the last day of the trip, Mr Azar visited a shrine to Taiwan's late president Lee Teng-hui Wednesday, praising his role in steering the island's transition to democracy. The US cabinet member wrote a message of condolence for Lee, who died last month aged 97. "President Lee's democratic legacy will forever propel the US-Taiwan relationship forward," Mr Azar wrote. Mr Lee was a towering figure in Taiwan's recent history. He defied China by pushing for the island to be recognised as a sovereign nation. Beijing, which claims Taiwan as its own territory, loathed Mr Lee. When news emerged of his death, Chinese state media called him "the godfather of Taiwan secessionism". Both Washington and Taipei portrayed Mr Azar's trip as an opportunity to learn from the success of Taiwan's battle against the coronavirus. The island has fewer than 500 infections and just seven deaths, compared with more than 160,000 fatalities in the United States. But the visit has also been an opportunity to ruffle Beijing's feathers at a time when US President Donald Trump is taking an increasingly hard line against China as he seeks re-election in November. "We will continue to support Taiwan as our friend and our partner across security, economic and healthcare issues," Mr Azar told reporters after a visit to a mask factory on Wednesday, shortly before flying back the the States. China takes umbrage at any formal recognition of Taiwan. It called for Mr Azar's trip to be cancelled and Taiwan accused Beijing of sending fighter jets over a de facto border on Monday, the day the US health chief met President Tsai Ing-wen. During his visit Mr Azar has repeatedly contrasted Taiwan's open, democratic system with China's leadership.