"It is a catastrophe," an emergency rescue service official said, as crews removed bodies and injured people from the aircraft belonging to Spanish airline Spanair.
Rachel Levin, reporting for Al Jazeera from the airport, said: "Black smoke is rising from the plane and the airport has been shut down.
"Ambulances are heading towards the scene."
A makeshift morgue was being set up at the city's main convention centre, officials said.
Chris Hodgkinson, technical director of the Guild of Airpilots and Air Navigators, told Al Jazeera: "One can only assume at this time that this was due to mechanical failure.
"It crashed close to the airport and broke into two pieces."
Helicopters and fire engines pumped water onto the burning plane, which had crashed into a wooded area at the end of the runway.
The aircraft's "black box" flight data recorder has been retrieved.
The plane's takeoff had been delayed by about an hour due to technical problems.
Jose Luis Rodriguez Zapatero, the Spanish prime minister, has interrupted his holiday in southern Spain to travel to Madrid airport, one of his officials said.
Madrid airport cancelled departures after the crash and restricted the number of aircraft arriving.
The MD-80 plane, which can carry up to 166 passengers, is operated by Spanair, Spain's second-biggest airline after Iberia, and is a subsidiary of Scandinavian carrier SAS.
Five passengers on a Spanair flight from Spain's Basque region to Barcelona were injured in an emergency evacuation on January 9, 2006.
The airline, which has a fleet of 65 jets, was founded in 1986 and says it has since carried more than 104 million passengers from about 100 European destinations to Spain.
It is a member of the Star Alliance network but recently proposed shedding almost a quarter of its 4,000 staff because of the fuel price rise crisis and reduced demand.