In the sandstone desert of China’s far west, a local meteorological station recorded an all-time high temperature of 126 degrees. In central China, heat-induced mechanical problems trapped tourists riding on a cable car in midair.

The heat wave choking China is so intense that it even became a repeated talking point for John Kerry, President Biden’s special envoy for climate change, as he met with China’s premier on Tuesday in Beijing to discuss cooperation on slowing global warming.

“You and I know things are changing,” Mr. Kerry told the premier, Li Qiang, while sitting in the Great Hall of the People, on the edge of Tiananmen Square. He mentioned the reports of the temperature in the western region of Xinjiang on Sunday; a commentator at China’s meteorological association had called it the highest he knew of in the country.

“In the last weeks, scientists have expressed greater concern than ever about what is happening on the planet,” said Mr. Kerry, who also met separately with Wang Yi, China’s top foreign policy official.

Indeed, the Chinese capital itself offered yet more proof of the urgency of combating climate change: Tuesday was the 27th day this year that Beijing has recorded temperatures above 35 Celsius, or 95 degrees Fahrenheit — the most number of days in one year since records began.

The heat wave, which has engulfed much of northwestern China, as well as parts of the northeast and southwest, is part of a round of exceptional heat worldwide. A large swath of the United States also is bracing for record-breaking temperatures. Experts called several days in early July likely the hottest in Earth’s modern history.

Mr. Kerry has said that he hopes China will curb its rapid expansion of coal plants, and reduce its use of methane, a greenhouse gas. China has resisted taking those steps, arguing it is a developing country that must continue to use fossil fuels to support its economic development. Mr. Kerry’s visit to Beijing this week marked the resumption of climate talks between the United States and China, the world’s largest polluters, which had been stalled since August.

In China, average surface temperatures in the country have risen faster than the global average since the early 20th century, according to a report this month by China’s National Climate Center. Last year, when the country was battered by another extended heat wave, China recorded its most “extreme high temperature events” since 1961. Leaders have suggested that heat could threaten China’s food security.

A study published in April in the journal Nature Communications identified the area around Beijing as one of the world’s most at-risk for extreme heat.

The soaring temperatures, which officials said started two weeks earlier than usual this year, have already taken a toll. Beijing, which in late June recorded its first-ever three consecutive days above 104 degrees, has reported at least two heat-related deaths this summer; one was a 48-year-old tour guide who died after leading a group of children through the Summer Palace. State media have also reported deaths in Hebei, Guangdong and Zhejiang provinces.

In central Henan Province last week, tourists riding cable cars in a mountainous area were trapped midair for 10 minutes, after the heat caused mechanical issues, according to state media. Officials have warned of potential power shortages, after demand for air conditioning caused extended blackouts last year in parts of the country. Last week, six power stations along the Yangtze River broke records for generating extra electricity, in addition to normal production, that had been set just last year, according to the official China Energy News.

In the southeastern city of Hangzhou, a heavy storm on Monday left the city “steaming like a sauna,” according to local media, as raindrops turned to steam upon hitting the scorching pavement. Other cities have opened air raid shelters to residents looking to cool off.

But some residents have few options for avoiding the heat. Around 3 p.m. in Beijing on Tuesday, as temperatures peaked around 97 degrees, a food delivery worker, Yang Chonghao, rested in the shade outside a popular shopping complex. He had worked through the previous weeks of 100-plus degree heat, waking at 6 in the morning and returning home around 8 or 9 at night. He had given up on wearing sun-blocking sleeves because it was simply too hot, he said.

“There’s no way to deal with it,” he said of the heat. “You can only bear it.”

The heat has been most intense in Xinjiang’s Turfan Depression, where the desert climate makes it regularly one of the hottest parts of China. The surface temperature in the Flaming Mountains there, a popular tourist spot of barren red sandstone, reached 176 degrees on Sunday, China’s state broadcaster said. The air temperature record, of 126 degrees, was measured in a township nearby.

Officials have warned that China is likely to suffer from both droughts and flooding this summer. Even as much of northern China baked this week, several southern provinces braced as the first typhoon to make landfall this year arrived on Monday, toppling trees and vehicles.

Joy Dong contributed reporting from Hong Kong.