Eight people died and thousands were taken to hospitals on Wednesday as a heat wave continued to scorch wide areas of Japan, sending the temperature to top 40 C in the central prefecture of Gifu, the highest recorded in the country in nearly five years.

The weather agency is warning of extremely high temperatures that are expected to continue through Thursday. The country has been having a heat spell following the rain disaster that devastated western Japan earlier in the month.

On Wednesday, the temperature hit 40.7 C in the city of Tajimi in Gifu, while that in the city of Mino, also in Gifu, reached 40.6 C. The last time the mercury topped 40 C was in August 2013 in Kochi Prefecture, when 41.0 C -- the country's highest on record -- was observed, the Japan Meteorological Agency said.

Eight people in eight prefectures died from heatstroke, including a 91-year-old man who was found collapsed in the garden of his home in Sakaiminato, Tottori Prefecture. Nearly 2,400 people were taken to hospitals across the country due to heatstroke or heat exhaustion, according to a Kyodo News tally.

The scorching heat already killed six people on Tuesday. Among them was a 6-year-old boy who fell unconscious after he attended an outdoor class for about two hours with his teacher and classmates in Aichi Prefecture.

(Ginza, central Tokyo)

During the week through last Sunday, 12 people died and 9,956 people -- 3.7 times higher than that of the previous week -- were sent to hospitals, according to a preliminary figure released by the Fire and Disaster Management Agency on Wednesday.

By prefecture, Osaka saw the largest number of people sent to hospitals at 752 people, followed by 704 in Tokyo and 687 in Aichi.

Of the 9,956 people, nearly 190 needed to be hospitalized for more than three weeks. People aged 65 or older accounted for 46.1 percent of the total.

The heat has also continued to make it difficult for relief operations in the regions ravaged by the recent flooding and landslides.

Although more than a week has passed from the downpour, more than 10 people remain missing in the prefectures of Hiroshima, Okayama, Ehime, Osaka and Nara, according to a Kyodo News tally.

About 4,700 people in 16 prefectures remained at shelters following the rain disaster as of noon Wednesday, according to the National Police Agency.

In the three hardest-hit prefectures of Okayama, Hiroshima and Ehime, about 140 people were taken to hospitals on Wednesday alone for suspected heatstroke.

In the areas hit by the downpour, Ozu in Ehime Prefecture logged 36.1 C, while Kurashiki in Okayama Prefecture and Fuchu in Hiroshima Prefecture recorded 36.1 C and 36.6 C, respectively.

(Heat haze seen in Gifu Prefecture)

Of 927 monitoring points nationwide, 190 points logged 35 C or higher on Wednesday, including the cities of Nagoya and Kyoto where the mercury surpassed 39 C, the weather agency said.

In Osaka Prefecture in western Japan, firefighters took nine female students to the hospital around 1 p.m. after receiving an emergency call from the school. Three of them were apparently in serious condition, they said. It was around 38 C at just past 2 p.m. in Osaka.

The Tokyo Fire Department said it received about 2,900 emergency calls on Tuesday, a record high for a single day since it started emergency services in 1936.

The Environment Ministry, which releases on its website a map based on colors to detail the risks of heat exhaustion or heatstroke, has decided to change the colors to make it easier to read for people with color vision deficiency.