Organizers of the annual New York City triathlon said Thursday that the race scheduled for this weekend is canceled because of the near-100 degree temps expected in the city on race day.

The triathlon — which would have featured nearly 4,000 athletes — was slated for Sunday in the city, when the mercury is expected to hover around 98 degrees in the region.

It’s the first time the race has been canceled since it began in 2001.

“It is with great disappointment that we announce the cancellation of the 2019 Verizon New York City Triathlon,” organizers said in a statement Thursday evening.

“After exhausting all options to mitigate athlete, volunteer, spectator and staff exposure alike, we are unable to provide either a safe event experience or an alternate race weekend,” they added.

Mayor Bill de Blasio on Thursday issued a “heat emergency” for the city over the weekend — and signed an executive order mandating all office towers above 100 feet to crank their thermostats up to 78 degrees beginning Friday and ending Sunday evening.

Some buildings were given a pass, including residential apartments and commercial spaces like shops and movie theaters.

“We are about to enter a heat emergency, and must do all we can to keep New Yorkers safe,” said de Blasio. “The City government is limiting its energy use to reduce strain on the electrical grid, and now private office buildings will also have to do their part.”