Media playback is unsupported on your device Media caption The BBC's Karishma Vaswani: Black box "vital part of the recovery process"

Indonesian divers have retrieved the flight data recorder of crashed AirAsia flight QZ8501, say officials.

They believe they have also located the cockpit voice recorder, the second part of the so-called black box, but divers have not yet managed to reach it.

AirAsia flight QZ8501 disappeared in bad weather on 28 December with 162 people on board.

The aircraft, which was flying from Surabaya in Indonesia to Singapore, is thought to be deep in the Java Sea.

Dozens of bodies have been recovered but most of the victims are believed to still be inside the fuselage, which has not been found.

Media playback is unsupported on your device Media caption Richard Westcott reports from a 'black box' investigation centre in the UK

Analysis: Karishma Vaswani, Jakarta

Information such as the condition of the engine, what the pilots were doing, whether the plane had stalled and its altitude will all be revealed from the data that is on the flight data recorder.

It is a total forensic timeline of everything that happened and is of immense importance to understanding what caused the crash.

Indonesia has said publicly that it will handle the analysis of the flight data and cockpit voice recorders here - but it is likely that international teams will also be involved. The unfortunate silver lining of having had so many air disasters over the last decade has meant that Indonesian teams are very well equipped to analyse the data recorders and piece together what happened. Aviation analysts expect a preliminary report within a month, and a more detailed report within a year.

Indonesian officials have been under intense pressure to find the cause of the crash. This discovery should provide some clues - and give families of those on board some semblance of closure.

Divers' grim race against time

Image copyright Reuters Image caption Investigators are checking the tail section for indications of what went wrong

Media playback is unsupported on your device Media caption The footage of the AirAsia plane has been captured by the Indonesian Navy

Speaking in Jakarta, the head of Indonesia's search and rescue agency Bambang Soelistyo told reporters: "I received information from the National Transport Safety Committee chief that at 07:11 (00:11 GMT), we succeeded in bringing up part of the black box that we call the flight data recorder."

He said the device was found under the wreckage of a wing.

Hours later, other officials said the cockpit voice recorder had also been detected but divers had not yet managed to reach it.

The two recorders, usually housed inside the rear part of the plane, are designed to survive a crash and being submerged in water. They contain underwater locator beacons which emit so-called "pings" for at least 30 days.

Supriyadi, operations co-ordinator for Indonesia's search and rescue agency, said that based on initial analysis of the wreckage, the plane could have "exploded" upon landing on the water.

"The cabin was pressurised and before the pressure of the cabin could be adjusted, it went down - boom. That explosion was heard in the area," he was quoted as saying by AFP news agency.

However, an investigator at the National Transportation, Santoso Sayogo, later told Reuters there was "no data to support that kind of theory".

Key information

Over the weekend, three ships detected pings that were thought to be from the black box's emergency locator transmitter. However, strong currents and high waves prevented the search operations.

The tail section of the Airbus A320-200 was brought to the surface, but the flight recorder was not inside it, as had been hoped.

Then on Monday, weather allowed for divers to retrieve the flight data recorder.

The international search for the fuselage and the remaining missing passengers and crew is continuing in the Java Sea.

Mr Soelistyo said all ships now "will be deployed with the main task of searching for bodies that are still or suspected to still be trapped underwater".