The constitution, which was adopted by a vote of 621 in favour, 13 against and eleven abstentions, among other things, protects the right to an abortion to save the mother's life and bans female genital mutilation.
It has taken eight years to come up with the constitution which makes it clear that Islamic law is the basis for Somalia's legal foundation.
The top United Nations envoy in Somalia, Augustine Mahiga, says Wednesday's adoption of the constitution is an important day for the country's peace process that has been going on for the past 21 years.
"First of all it ends the transitional period which has been in place for nine years, but secondly it gives the Somali people a constitution for the first time in 40 years and lays a foundation as a legal basis for a new dispensation which will begin on 21 August this year after ending the transition. It is one of the two major steps that were necessary to be accomplished in order to end the transition. The second one will be the formation of a new parliament next week."