The 15-member council unanimously adopted a British-drafted resolution that also renewed a 17,600-strong African Union peacekeeping force for a year and reconfigured the U.N. mission in the Horn of Africa country.
Somalia's government had asked for the arms embargo to be removed and the United States supported that, but other Security Council members were wary about completely lifting the embargo on a country that is already awash with weapons, diplomats said.
"What we have tried to do is draw a balance between those who wanted an unrestricted lifting of the arms embargo and those who felt it was premature to lift the arms embargo," Britain's U.N. Ambassador Mark Lyall Grant told reporters after the vote. "It is a good and strong compromise."
The Security Council imposed the embargo on Somalia in 1992 to cut the flow of weapons to feuding warlords, who a year earlier had ousted dictator Mohamed Siad Barre and plunged the country into civil war. Somalia held its first vote since 1991 last year to elect a president and prime minister.
"Yes there are major challenges, but we are now ... moving away from international trusteeship of the situation in Somalia towards supporting the government's efforts to address its own problems," Lyall Grant said.
The Security Council resolution would allow sales of such weapons as automatic assault rifles and rocket-propelled grenades, but leaves in place a ban on surface-to-air missiles, large-caliber guns, howitzers, cannons and mortars as well as anti-tank guided weapons, mines and night vision weapon sights.
It also requires that the Somalia government or the country delivering assistance notify the Security Council "at least five days in advance of any deliveries of weapons and military equipment ... providing details of such deliveries and assistance and the specific place of delivery in Somalia."
"The progress achieved (in Somalia) does not justify so far the lifting of the arms embargo," Guatemala's U.N. Ambassador Gert Rosenthal told the council after the vote.
"We believe that the Security Council should have adopted a phased approach to prevent the possible repercussions of an abrupt suspension of the embargo which could subsequently compromise the stabilization efforts in Somalia."
ARMS TO EXTREMISTS
The Somali government believes lifting the embargo will help it strengthen its poorly equipped, ill-disciplined military, which is more a collection of rival militias than a cohesive fighting force loyal to a single president.
"The support is a vote of confidence for the government of Somalia given the improvement of the security situation in that country," Argentina's U.N. Ambassador Maria Cristina Perceval told the Security Council.
The AU peacekeeping force - made up of troops from Uganda, Burundi, Kenya and Ethiopia - is battling al Shabaab militants on several fronts in Somalia and has forced them to abandon significant territory in southern and central areas.
The militants, who affiliated themselves with al Qaeda in February last year, launched their campaign against the government in early 2007, seeking to impose sharia, or strict Islamic law, on the entire country.
The Security Council's Monitoring Group on Somalia and Eritrea, an independent panel that reports on compliance with U.N. sanctions, has warned that the Islamist militants in Somalia are receiving weapons from distribution networks linked to Yemen and Iran, diplomats have told Reuters.
A diplomat also said U.N. monitors had reported that some al Shabaab militants had infiltrated units of the Somali security forces.
"Clearly over the coming year if the suspension of the arms embargo is being abused, then we will take action accordingly in the Security Council," said Britain's Lyall Grant.
The resolution says that weapons and equipment "may not be resold to, transferred to, or made available for use by, any individual or entity not in the service of the security forces of the federal government of Somalia."
It asks the Somalia government to report regularly on the structure of the security forces and the infrastructure and procedures in place to ensure safe storage, maintenance and distribution of military equipment.
Human rights group Amnesty International called one the U.N. Security Council on Monday not to lift arms embargo on Somalia, describing the idea as premature and warning that it could "expose Somali civilians to even greater risk and worsen the humanitarian situation.