Eleven members of the council voted in favor of the resolution, while four abstained. The Council also extended the mandate of the Somalia and Eritrea Monitoring Group until 15 December 2018, a UN statement said.
The arms embargo on Somalia did not apply to deliveries of military goods for the federal security forces, the statement said.
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.
In 2014, the 15-nation Security Council agreed to partially lift the arms embargo on Somalia, allowing the government in Mogadishu to buy light weapons to strengthen its security forces in the fight against terror group al-Shabaab.
Eritrea on the other hand was slapped with arms embargo by UN in 2009. The Horn of Africa nation was arming Islamist militants in Somalia.
A recent report by a UN mandated team of experts on Somalia and Eritrea, however, said there was no conclusive evidence of relations between Eritrea and the militant group Al-Shabaab.
The 60-page document asked the UN Security Council to consider lifting the arms embargo on Eritrea.