Unseasonably hot conditions gripped wide areas of Japan on Sunday, with the mercury topping 39 C in a town on the northern main island of Hokkaido, a national record for the month of May.

The hot weather led to the deaths of a man in Hokkaido and another in the northeastern prefecture of Miyagi, and at least 575 people across the country were taken by ambulance to hospitals to be treated for heatstroke symptoms, according to official data compiled by Kyodo News.

The town of Saroma marked 39.5 C, a record-high temperature for any time in Hokkaido. The previous record for May was 37.2 C, set in 1993 in Chichibu, northwest of Tokyo, according to the Japan Meteorological Agency.

Temperatures in the month of May had never reached 35 C in Hokkaido and the previous all-time high in the region was 37.8 C.

Of the agency's 926 monitoring posts across the country, 53 locations, mainly in Hokkaido, registered temperatures of 35.0 C or higher, while the mercury in 513 locations in many parts of the country climbed above 30 C.

The weather agency expects the unusually hot conditions to continue on Monday.

Related coverage:

Temperatures rise across Japan, 460 taken to hospitals

Over 300 stranded people rescued on Yakushima Island after heavy rain