Media playback is unsupported on your device Media caption Hundreds of flights were cancelled after the company stopped operating on Friday

Spain's fourth-largest airline Spanair has collapsed, leaving more than 20,000 passengers stranded across Europe and Africa.

The Barcelona-based firm stopped operating on Friday and more than 200 flights were abruptly cancelled.

The Spanish government is taking legal action and said Spanair could be fined 9m euros (£7.6m; $11.9m) over the collapse.

In 2010, Spanair reported an operating loss of 115m euros.

The collapse comes after Qatar Airways stopped takeover talks, ending the prospect of further financing, and also reflects weak demand for air travel in Spain.

In 2008 a Spanair plane was involved in Spain's worst aviation disaster in 25 years, when it crashed on takeoff as it tried to leave Madrid's Barajas airport, killing 154 people. The aircraft's wing flaps were incorrectly positioned and a warning system failed to alert the pilots.

Ryanair's 'opportunity'

The airline was seen as a flagship of the regional government of Catalonia, which had helped it stay afloat with more than 150m euros of subsidies.

The government refused to provide more funding on Friday.

Low-cost airlines like Ryanair and Easyjet had challenged the legality of the subsidies to the European Commission.

On Monday, Ryanair said it was examining opportunities in Spain following the collapse of Spanair. "We certainly see it as an opportunity to expand our base," it said.

Spanair's collapse could lead to the loss of 4,000 jobs.

The airline was once owned by Scandinavia's SAS Airlines, which still has an 11% stake in the firm.

SAS said that the bankruptcy of Spanair would lead to write-downs of 1.7bn kronor (£160m) for the full year 2011.

Spanair has put a statement on its website with information for customers.