Chinese leader Xi Jinping has arrived in Hong Kong ahead of the 25th anniversary of the British handover.

His visit follows a two-year transformation which brought the city more tightly under Communist Party control.

It is Mr Xi’s first trip outside of mainland China in nearly two and a half years.

Supporters at the train station waving Chinese and Hong Kong flags greeted the Chinese President as his train pulled into the station on Thursday.

Mr Xi and his wife, Peng Liyuan, were welcomed by the city’s leader, Carrie Lam, as they alighted the train. Mr Xi waved at the supporters who welcomed him on the platform.

Elsewhere in the train station, supporters stood on either side of a red carpet, also waving Chinese and Hong Kong flags. Some held up banners welcoming Mr Xi and a lion dance performance was held.

Hong KongStudents attend a Chinese national flag raising ceremony during at a secondary school to mark the 25th anniversary of Hong Kong handover to China (AP)

“I’m very happy to be in Hong Kong,” Mr Xi said in a speech at the Hong Kong West Kowloon train station.

“It’s been five years since I last visited, and in the past five years I’ve been paying attention to and thinking about Hong Kong.”

Mr Xi is expected to speak about Hong Kong’s future at a ceremony on Friday marking the return of the former British colony to Chinese rule on July 1 1997.

Under his leadership, China has reshaped Hong Kong in the past two years, cracking down on protest and freedom of speech and introducing a more patriotic curriculum in schools. The changes have all but eliminated opposition voices and driven many to leave.

Xi JinpingMr Xi arrives in Hong Kong (Pool via AP)

Hong Kong and nearby Macao are special administrative regions that are governed separately from the rest of China, known as the Chinese mainland.

Mr Xi has not left China since the Covid-19 pandemic took hold. China has maintained a strict “zero-Covid” policy that aims to keep the virus out.

The Chinese leader’s last overseas trip was to Myanmar in January 2020.

Mr Xi said Hong Kong has overcome many challenges over the years and had been “reborn from the ashes” with “vigorous vitality”.

“As long as we stick to the ‘one country, two systems’ framework, Hong Kong will certainly have a brighter future and will make new and bigger contributions to the great rejuvenation of the Chinese people,” he said.

Later, after a meeting with Ms Lam, Mr Xi praised her for ending what he said was chaos that had gripped the city and for ensuring that only “patriots” would rule Hong Kong.