The 15-member council voiced support for a second round of UN-brokered talks to be held in Geneva next week and strongly urged all warring sides to attend.
A first round of talks yielded an agreement on a roadmap to forming a unity government in Libya.
The Fajr Libya (Libya Dawn) militia, which did not take part in the first round of Geneva talks, announced a ceasefire on Friday.
Signup to our newsletter and follow us on Facebook and Twitter!
"There can be no military solution to the crisis in Libya," the council said in a unanimous statement.
The top UN body "is prepared to sanction those who threaten Libya's peace, stability or security or that obstruct or undermine the successful completion of its political transition," it added.
Libya has been sliding deeper into conflict since the 2011 overthrow of Moamer Kadhafi, with rival governments and powerful militias battling for control of cities and the country's oil wealth.
The ceasefire announced by Fajr Libya, which seized the capital Tripoli last summer and also holds the third city, Misrata, provided a boost to UN efforts to persuade key players to negotiate an end to the fighting.
The council praised UN envoy Bernardino Leon for his mediation efforts in the talks that were billed as a last-ditch effort to launch a peace process for Libya.