The Il-76 airliner, which was carrying humanitarian cargo as part of a UN mission, was hit by a grenade or missile fired from a small boat while landing.
The crew and nine people on board were not injured, and the plane, which was at an altitude of 150 meters (450 feet) when it was hit, managed to land despite a heavily damaged fuselage.
"The decoding of the flight data recorders will be done in Belarus," the country's aviation department said. "The crew was instructed to dismantle the recorders after the incident and send them to Minsk."
Transaviaexport, the air company that owns the Il-76, delivers humanitarian aid to many countries, including Iraq and Afghanistan. None of its aircraft has ever been involved in a similar incident, but the company said it would not withdraw from humanitarian efforts.
Mogadishu has been plagued by violence since former President Mohamed Siad Barre was ousted in 1991. The civil war-torn East African state, which has no recognized central government, has also struggled to cope with famine and disease relying on UN aid.