Mohamud said this while addressing a security conference in Germany, Sunday.
“Without a stable Somalia, the whole region of the Horn of Africa will remain unstable and by and large, the African continent. There are proofs and evidence that (for) some time Boko Haram has been trained in Somalia and they went back to Nigeria.
“The terrorists are so linked together, they are associated and so organised, (that) we the world we need to be so organised.”
It was not clear from his comments whether he believed al Shabaab was still training Boko Haram fighters, who have pledged allegiance to Islamic State militants in Syria and Iraq (ISIS).
Somalia has been plagued by political in-fighting, corruption and attacks by al Shabaab insurgents. The East African country has made limited progress towards creating a functioning political system.
Somalia’s al Shabaab, which is linked to al Qaeda and wants to overthrow the Somali government and impose a harsh version of the Islamic law, claimed responsibility for a blast this month that punched a hole in the fuselage of a plane.