As tension spikes between China and the United States over a visit by US House Speaker Nancy Pelosi to Taiwan, here is a look back at relations between the self-governing island and its much bigger neighbour.

1949: Separation

Mao Zedong's communists take power in Beijing in October 1949 after defeating Chiang Kai-shek's Kuomintang (KMT) nationalists in a civil war.

The KMT flee to the island of Taiwan and form their own government in Taipei in December, cutting off contacts with mainland China.

In 1950, Taiwan becomes an ally of the United States, which is at war with communist China in Korea. The US deploys a fleet in the Taiwan Strait to protect its ally from possible attack.

1971: Beijing gets UN, US nods

In October 1971, Beijing takes over China's seat at the United Nations, previously held by Taipei.

In 1979, the United States cuts formal ties with Taiwan and establishes diplomatic relations with Beijing instead.

Washington expresses support for the "One China" policy, which states that Taiwan is part of China, but maintains trade and military ties with Taipei.

Chiang Kai-shek

1987-2004: Relations improve

In late 1987, Taiwan residents are for the first time permitted to visit mainland China, allowing families to reunite.

In 1991, Taiwan lifts emergency rule, unilaterally ending a state of war with China. The first direct talks between the two sides are held in Singapore two years later.

But in 1995, Beijing suspends talks in protest at a visit by Taiwanese president Lee Teng-hui to the US.

In 1996, China tests missiles off Taiwan to deter voters in the island's first democratic presidential election.

In 2000 elections, the KMT loses power in Taiwan for the first time. Over the next few years trade links between the two sides improve.

2005-2015: Threats and talks

In March 2005, Beijing adopts a law authorising the use of force if Taiwan declares independence. In April, KMT chairman Lien Chan makes a landmark visit to Beijing for talks with Chinese leader Hu Jintao.

In 2008, Taiwan and China resume high-level talks after the KMT's Ma Ying-jeou is elected president on a Beijing-friendly platform.

In 2010, they sign a sweeping Economic Cooperation Framework Agreement and in 2014 hold the first government-to-government talks since separation.

2016: Honeymoon over

In January 2016, Tsai Ing-wen, from the traditionally pro-independence Democratic Progressive Party, wins presidential elections.

In June, China suspends all communications with Taiwan after the new government fails to acknowledge the "One China" policy.

In December 2016, US president-elect Donald Trump breaks with decades of US diplomatic policy by speaking directly, by telephone, with Mr Tsai.

In January 2019, Xi Jinping warns that the unification of China and Taiwan is "inevitable".

A Taiwanese navy launches a US-made Standard missile during a test last month

2021: US-China tension

In 2021, Chinese military jets make hundreds of incursions into Taiwan's defence zone.

In October, US President Joe Biden says the United States will defend Taiwan if China attacks it, in comments later partly walked back by the White House.

Tsai confirms that a small number of US troops are present in Taiwan to help train its forces.

2022: Furore over Pelosi tour

On 23 May, Mr Biden urges the West to stand firm against Russia over Ukraine to deter China from trying to take Taiwan by force, and repeats that the US will defend Taiwan in the event of an invasion.

On 28 July, Mr Xi tells Mr Biden by phone not to "play with fire" and warns of "consequences" if US House Speaker Nancy Pelosi goes ahead with a reported plan to visit Taiwan on an Asia trip.

Tension soars as Ms Pelosi arrives in Malaysia, with China warning that the US will "pay the price" if she sets foot in Taiwan. The White House insists that she "has the right to visit".