MADRID (AP) - An approaching wildfire in eastern Spain caused a train driver to stop and prepare to change directions to avoid the flames, and several passengers were injured when they got off rather than wait, authorities said Wednesday.

The train was traveling in the Valencia region on Tuesday night when the driver decided to reverse course because of the wildfire advancing from around the town of Bejis, further east.

Some passengers got off the train when it stopped in the countryside, including ones who broke windows to escape, officials said. Ten people were injured, Spanish state news agency Efe reported.

The government of Castellon province on Wednesday tweeted a video of firefighters running for their lives as towering flames from the Bejis fire roared behind them.

The wildfire is one of two still raging out of control in eastern Spain.

South of Valencia city, a fire around the Val d'Ebo area has burnt 11,500 hectares (28,000 acres) and forced more than 1,500 people to evacuate towns and villages since the weekend.

The region's emergency services tweeted Wednesday afternoon that nearly 10,000 hectares (25,000 acres) have been burned in the Bejis fire and 1,500 people moved from their homes.

Valencia regional president Ximo Puig said earlier that the Bejis fire had a perimeter of some 50 kilometers (30 miles) and the Val d'Ebo blaze had a perimeter of 80 kilometers (50 miles).

The European Forest Fire Information System says 275,000 hectares (679,000 acres) have burned in wildfires so far this year in Spain. That's more than four times the country's annual average of 67,000 hectares (165,000 acres) since 2006, when records began.

In neighboring Portugal, authorities said they hoped to bring under control a wildfire that has burned for 12 days and burnt large swaths of pine forest in the Serra da Estrela Natural Park.

However, officials warned a new heat wave forecast for the area could complicate the task.

Smoke from the Portuguese fire reached Spain's capital, Madrid, about 400 kilometers (240 miles) to the east, on Tuesday.