A British diplomat has become a hero in China after a video of him rescuing a student from a swollen river racked up tens of millions of views on social media.

Britain's mission in Chongqing said that Consul General Stephen Ellison leapt into action at the weekend to save a woman who had fallen into a river flowing through a nearby tourist town.

"Due to the timely rescue, the woman quickly recovered her breathing and consciousness," read the post on the consulate's official Weibo page.

Mr Ellison, 61, was visiting the town on Saturday when he heard a cry from a crowd of people as the woman fell into the water.

Video footage shared by the consulate and various Chinese media outlets shows Mr Ellison jump fully clothed into the river, where the unnamed woman was struggling to stay afloat.

Mr Ellison, by several media accounts an accomplished triathlete, dragged her to a lifebuoy thrown from the riverbank before dragging the two of them to shore.

"We are all immensely proud of our Chongqing Consul General," the UK diplomatic mission in China tweeted.

Mr Ellison's actions earned praise from his boss back in the London, Foreign Secretary Dominic Raab, who echoed the sentiments.

"Very proud of Stephen Ellison, our new Consul General in Chongqing, China, for saving a student from drowning at the weekend," he tweeted.

The hashtag "British Consul-General in Chongqing saves female student who fell in the water" had gained almost 40 million acknowledgements on Weibo by yesterday evening.

"For a man of such advanced age to save another person from the water in such cold weather, regardless of his own safety, he is a hero and gentleman!" read one comment, liked nearly 2,000 times.

"Regardless of our differences ... to act heroically is a virtue and should be praised," wrote another.

Mr Ellison took up his post in June after serving as a senior diplomat at the British Embassy in Beijing since 2014.

UK-China ties have been strained this year over the UK's decision to ban Chinese telecoms giant Huawei from its 5G networks, as well as the UK's frequent criticisms of China's human rights record on issues including Hong Kong and Xinjiang.