British troops could be sent to Libya to help train local forces if its new government requests help to tackle the spread of Islamic State (IS).
A UN-sponsored deal on forming a unity government aimed at ending Libya's conflict has been signed by members of the country's rival parliaments.
Downing Street said the UK Government would consider any request for assistance from a new administration in Libya, but ruled out sending combat troops to the country.
Foreign Secretary Philip Hammond said the UK "stands ready" to help deliver a stable Libya and tackle the threat from IS, also known as Daesh and Isil.
Supporters of the agreement, which was sealed following talks in Morocco, hope rival political factions and militias will embrace the deal and implement a ceasefire, so they can turn their attention to IS.
Downing Street made clear it would support a new administration in Libya but if any troops were sent to the country they would not be in a combat role.
"No decisions have been made about any future deployment of British troops to Libya," a Number 10 spokesman said.
"We have always been clear we would look to support a unity government if one were to be formed and if one is formed we would obviously need to wait for any requests that they put to us before we would then make a decision.
"We have always certainly been clear that if any troops were ever deployed on the back of a request from that government, that they certainly would not be in a combat role."
Mr Hammond said: "This is a positive step for Libya and I commend those who have worked together to seek consensus in the interests of all the Libyan people.
"To ensure a lasting peace in Libya, all parties must maintain this momentum to create a government of national accord based in Tripoli. I also urge those who have not yet signed to support this agreement.
"The UK Government stands ready to work to help deliver a stable and prosperous future for all Libyan citizens, and to tackle the threat from Daesh and criminal gangs who have contributed to the migration crisis in the Mediterranean."
The Times said Britain is preparing to send up to 1,000 troops and special forces to the North African country to help it resist the advances of IS.
It reported that British military personnel could contribute to a 6,000-strong Italian-led mission to train and support Libyan security forces.
Libya descended into chaos following the ousting of Muammar Gaddafi in 2011, with factional violence and the lack of a stable government opening the door for IS to make gains in the country.
A Tory member of the Commons Foreign Affairs Select Committee suggested that British air strikes could be needed to stop IS in its tracks.
Daniel Kawczynski warned that IS, also known as Isis, is shifting to Libya from Syria, where it is being targeted by international forces including the UK.
"I believe passionately that if the government of national unity requests the support of Western forces to take on Isis, I think it will be highly irresponsible and foolish for us not to consider that, bearing in mind that we left that vortex for the Libyan people to grapple with - I'm not blaming the Government but that is the reality of the situation," he said.
Mr Kawczynski told BBC Radio 4's World at One: "If the situation with Isis deepens and gets worse, we will have to contemplate helping the Libyan government to eliminate Isis and that may require a bombing campaign."
He said IS is "extraordinarily strong" in Libya with large numbers of fighters leaving Syria to "form what they hope to be a new alternative state" based around Sirte.
In an echo of the group's land grab in Syria, IS is heading towards the valuable oil fields which could provide it with a source of revenue, the MP said.
"We have to take them on, whether it's in Syria or whether it's in Libya. Now is the time to show extensive force against them, in coalition with other countries, to try to eliminate them.
"If we don't take them on in Syria and we don't take them on in Libya then we are leaving ourselves to the possibility that they will just magnify in strength, their tentacles will spread even further."