Dozens of pro-Beijing lawmakers walked out of the Hong Kong legislature on Wednesday to prevent the swearing-in of two pro-independence activists, setting the scene for a new constitutional crisis in the Chinese-controlled city.

The topic of independence has long been taboo in the former British colony, now governed under the "one country, two systems" principle since its return to Communist Party-ruled China in 1997.

The government failed in an unprecedented legal attempt to halt the swearing-in of the two newly elected legislators, Baggio Leung, 30, and Yau Wai-ching, 25, late on Tuesday evening.