The UN Security Council has unanimously adopted a resolution to step up the fight against armed groups in Libya, but without lifting the arms embargo.
Libya, backed by Egypt, had asked for an end to the embargo to allow the embattled government to build up its army and take on groups such as the Islamic State of Iraq and the Levant (ISIL).
But Friday's resolution, drafted by Jordan, kept the four-year arms embargo in place while opening the door to exemptions on a case-by-case basis.
The measure called on a Security Council committee to "consider expeditiously" requests for arms purchases from Libya.
Earlier this month, eight Security Council members led by Spain froze indefinitely a request from Libya for purchases of fighter jets, attack helicopters, tanks and munitions.
The refusal to allow the arms purchases followed a letter from a UN panel of experts warning that the arms shipments could fall into the wrong hands.
Libya is awash with weapons and considered a major arms-trafficking hub for North Africa, as powerful armed groups battle for control of key cities and the country's oil riches.
The resolution expressed "grave concern" about the growing presence of ISIL fighters in Libya and of groups that have pledged allegiance to ISIL, along with those aligned with al-Qaeda.
The measure threatened sanctions against individuals and groups that support the fighters through financing, recruitment or through the internet and social media.
The 15-member council also voted to extend the mandate of the UN political mission in Libya until September, with a view to helping the country's warring sides reach a power-sharing deal.
The UN is leading negotiations between Libya's rival legislative sides on forming a unity government that could turn its full attention to confronting the threat from armed groups.