Flight QZ8501 lost contact with air traffic control in bad weather on December 28, less than halfway into a two-hour flight from Indonesia's second-biggest city of Surabaya to Singapore.
"At 7:11, we succeeded in lifting the part of the black box known as the flight data recorder," Fransiskus Bambang Soelistyo, the head of the National Search and Rescue Agency, told reporters at a news conference.
"We are still trying to find the cockpit voice recorder."
Officials hope the black box, which was found under the wrecked wing of the plane, will reveal the cause of the crash. The national weather bureau has said seasonal storms were likely a factor.
Investigators have said the recorder would most likely be taken to the capital, Jakarta, for analysis and that it could take up to two weeks to download the data.
However, the information could be accessed in as little as two days if the devices are not badly damaged.
Soelistyo did not provide any details of the condition of the flight data recorder.
Over the weekend, three vessels detected "pings" that were believed to be from the black boxes' emergency locator transmitter. But strong winds, powerful currents and high waves hampered search efforts.
Indonesian navy divers took advantage of calmer weather in the Java Sea on Monday to retrieve the flight recorder and search for the fuselage of the Airbus A320-200.
Forty-eight bodies have been retrieved from the Java Sea and searchers believe more will be found in the plane's fuselage.
Relatives of the victims have urged authorities to make finding the remains of their loved ones the priority.
"All the ships, including the ships from our friends, will be deployed with the main task of searching for bodies that are still or suspected to still be trapped underwater," Soelistyo said, referring the multinational force helping with the search and recovery effort.
Indonesia AirAsia, 49 percent owned by the Malaysia-based AirAsia budget group, has come under pressure from authorities in Jakarta since the crash.
The transport ministry has suspended the carrier's Surabaya-Singapore licence for flying on a Sunday, for which it did not have permission. However, the ministry has said this had no bearing on the crash of Flight QZ8501.
President Joko Widodo said the crash exposed widespread problems in the management of air travel in Indonesia.
Separately on Sunday, a DHC-6 Twin Otter operated by Indonesia's Trigana Air crashed on landing at Enarotali Airport in Paniai, Papua.
Strong winds caused the aircraft to roll over, domestic news website Detik.com reported, with no injuries to the three crew members on board. The plane was not carrying any passengers.