Leaders of Libya's new unity government have arrived in the capital, Tripoli, by boat in an attempt to take control.
Over recent days, Tripoli's airspace has been intermittently closed to stop the Presidency Council, which has been based in Tunisia, from arriving by air.
Libya's UN envoy called for "a peaceful and orderly handover".
But hardliners in the coalition that controls Tripoli are opposed to the UN-brokered deal aimed at reconciling a nation split by five years of conflict.
In a televised address, the head of the Tripoli authorities, Khalifa Ghweil, said he regarded the politicians as interlopers and said they were not welcome.
He urged "the illegitimate outsiders to surrender and be safe in our custody or to return to where they came from".
Late on Wednesday, journalists from a television channel supportive of authorities in Tripoli said it was taken off air after gunmen stormed its offices. It was not clear to whom the gunmen were affiliated.
Libya has been in chaos since the 2011 overthrow of long-serving ruler Muammar Gaddafi by Nato-backed forces.
From 2014 it has had two competing administrations, one in Tripoli backed by powerful militias and the other about 1,000km (620 miles) away in the port city of Tobruk.
Militias in charge, says BBC's North Africa correspondent Rana Jawad
In the first hours after the politicians' arrival at the navy base, militias on armed pick-up trucks were seen securing most parts of the capital. But by early evening, gunfire from rival groups started ringing out.
It is not clear what their plan is, but things are now tense.
Many of the brigades in western Libya have fallen in line behind the Presidency Council. However, the reality is that these are the very same militias who led and facilitated the existence of the rival authorities in Tripoli since 2014.
Their continued prominent role means their status will not change - it simply puts any new government at their mercy. Ultimately they are Libya's rulers.
Militia allegiances often shift out of convenience and with the need to survive.
Key to any progress and long-term transformation of Libya will be having a government that can control these brigades.
In December, some rival lawmakers signed up to the UN agreement to form a unity government, but the deal has not yet been backed by all the country's many militia brigades that formed after the uprising.
The deal saw the formation of a nine-member Presidency Council, which includes the unity Prime Minister Fayez Sarraj who arrived with some of his deputies at a naval base in Tripoli on Wednesday.
Mr Sarraj said it was time to turn a new page and reconcile, saying he intended to build state institutions and implement a ceasefire.
"Revenge, alienation, antipathy, and hatred don't build a state," the AP news agency quoted him as saying.
The BBC's North Africa correspondent Rana Jawad says the Presidency Council has faced numerous challenges since its formation, chief of which has been its inability to establish a presence in Tripoli.
UN envoy Martin Kobler said the politicians' arrival in Tripoli - after at least two failed attempts to fly in - marked "an important step in Libya's democratic transition and path to peace, security and prosperity".
In a statement, he "urged all public bodies, including official financial institutions, to facilitate an immediate, orderly and peaceful handover of power".
US Secretary of State John Kerry said it was "not the time for obstructionists to hold back progress".
But our reporter says it is not clear how Mr Sarraj and his colleagues will be able to take over state institutions in Tripoli, given the stiff rivalry they face and the fact that members of his proposed cabinet are based all over the country.
The political and security vacuum in Libya has helped the so-called Islamic State group to establish a foothold in the north African country, carrying out attacks on cities and against oil installations.
Who is Fayez Sarraj? By BBC Monitoring
Prime Minister Fayez Sarraj was born in Tripoli in 1960 into a prominent local family. His politician father, Mustafa, held office under King Idris, whose 18-year monarchy ended in 1969 when he was overthrown by Muammar Gaddafi.
Al-Jazeera TV has described Mustafa Sarraj as "one of the founders of the modern state of Libya after its independence from Italy".
During the Gaddafi era, Fayez Sarraj was not prominent politically but did hold several posts at the Housing Ministry.
After the uprising in 2011, he became a member of the National Dialogue Commission - a group trying to establish national consensus and unity in Libya.
He was later nominated for membership of the House of Representatives for the constituency of al-Andalus in Tripoli.
His choice as prime minister was seen as a compromise as he is not affiliated to any political party involved in the power struggle.