Alvaro Barrientos, Associated Press
A man views a fire before walking on the burning embers, top right, during the night of San Juan, in San Pedro Manrique, northern Spain, Tuesday, June 23, 2015. More than 1,350 residents were evacuated in Spain's northeastern region of Aragon as a wildfire spread through a pine forest amid a lingering heat wave, a local official said Sunday.

MADRID — More than 1,350 residents were evacuated in Spain's northeastern region of Aragon as a wildfire spread through a pine forest amid a lingering heat wave, a local official said Sunday.

Five villages were evacuated as flames devoured hills that are 375 kilometers (230 miles) northeast of Madrid, said Javier Lamban, the president of Aragon. The evacuees, who included residents of a retirement home, were transferred to nearby towns.

About 500 firefighters and almost 100 pieces of equipment, including aircraft, were fighting the flames Sunday, which were being fanned by windy conditions and were creating a large plume of smoke.

The fire, which broke out Saturday afternoon, has already burned close to 8,000 hectares (19,770 acres) of forest in a remote area, according to Ministry of Agriculture and Environment spokesman Modesto Lobon.

Also, the fire department in the northeastern region of Catalonia said it was combating a wildfire that had broken out in Cardedeu, 40 kilometers (25 miles) north of Barcelona, and had destroyed two houses and several cars, although no one was injured.

Weather stations across Spain had warned people on June 27 to take extra precautions as a heat wave that was due to engulf much of the country for an extended period of time increased the risk of wildfires.

Spain's meteorological agency predicts that hot weather across the Iberian Peninsula, with temperatures reaching 40 C (104 F), will last another week.

In Portugal, the National Civil Protection Authority said almost 100 firefighters were tackling a wildfire that broke out Saturday night in the forests of Alcobertas, north of Lisbon.