Two people were injured before the pilot landed safely, a passenger said.
Somali authorities later discovered a body near Mogadishu they believe fell from the Daallo Airlines plane.
Pictures from the ground showed a hole in one side of the airliner, just above its wing and slightly smaller than one of its doors.
Evidence recovered from the airliner indicates a bomb was responsible for the explosion, according to a U.S. official.
An airport official estimated the Daallo plane was between 12,000 and 14,000 feet high when the blast occurred not long after it took off from Mogadishu International Airport.
The pilot then flew the Airbus A321-111, which had originated in Jeddah on Saudi Arabia's Red Sea coast, back to the Somali capital.
No group immediately took responsibility for the act.
However, the U.S. official told CNN that investigators believe extremist group Al-Shabaab is responsible for the explosion. Al-Shabaab has been behind some of the worst violence in recent years in and around Somalia.
Some of it targeted tourists, such as last month's deadly attack on a beachside restaurant-hotel complex in Mogadishu. Young people also have been targets, as shown in the massacre at Kenya's Garissa University College. The general public also hasn't escaped the group's violence, as evidenced in a 2013 assault on an upscale mall in Nairobi.