Shanghai: Shanghai roasted under some of its hottest temperatures ever recorded on Wednesday as a searing heatwave in China triggered a flurry of weather alerts and strained the farming and energy sectors.

Swathes of the northern hemisphere have sweltered under extreme heat this week, with France and Britain set to endure soaring temperatures on Wednesday as firefighters in western Europe battle forest blazes.

China has also suffered extreme weather this summer, with record floods last month forcing hundreds of thousands of people out of their homes while other regions have simmered in road-buckling heat.

Scientists say that heatwaves have become more frequent due to climate change, and will likely become longer and more intense as global temperatures continue to rise.

At a central Shanghai weather station on Wednesday, the mercury climbed to 40.9 degrees Celsius (105.6 Fahrenheit) by 2:30 pm, the official news site of the national meteorological service reported.

The figure "matched the record highest air temperature in the local area since records began in 1873," the article said.

Social media users bemoaned the stifling weather, with one user on the popular Weibo platform saying they "felt like meat on a barbecue when I went for my Covid test just now."

"Maybe it'll burn off all the virus," another commented.

Photos on social media showed health workers in Shanghai sitting or lying on blocks of ice to cool down as they carried out a mass testing drive aimed at stemming a rise in Covid-19 cases.

The economic hub experienced a gruelling virus lockdown earlier this year that confined most of its 25 million residents to their homes for around two months.

A spate of heat warnings were in place across eastern and southern China on Wednesday as authorities warned that temperatures could hit 42C in certain areas.

Some media outlets reported heat-related deaths.

Authorities have also warned of potential damage to agriculture, saying Monday that the heat was "not conducive" for the growth or harvest of rice, corn, cotton and other crops.

Electricity consumption has hit records in several parts of the country as people and businesses have cranked up air conditioners to stay cool, Bloomberg News reported.

China is no stranger to hot summers, but this year is shaping up to be a scorcher even by the country's standards.

Authorities in seven provinces last month warned millions of residents not to go outdoors as temperatures edged towards 40C, as state media showed footage of roads that had cracked under extreme heat.

At the same time, multiple places across the south chalked up record rainfall and flood levels after the National Climate Centre forecast "relatively worse" and "more extreme" deluges than previous years.