TRIPOLI — Members of Libya’s presidential council reached Tripoli on Wednesday, defying opposition attempts to keep them out of the city as they prepare the ground for a United Nations (UN)-backed unity government whose ministers they nominated.

Seven members of the council including Fayez Seraj, its head and the new government’s prime minister, arrived by boat from Tunisia at Tripoli’s Abusita naval base amid tight security, witnesses said.

A separate self-declared government also based in Tripoli and armed groups that back it have warned the council and the unity government not to travel to the capital. Tripoli’s airspace was closed for several hours on Sunday and Monday to prevent council members from reaching the city.

Mr Seraj said the council members had travelled in a Libyan navy vessel from the Tunisian port of Sfax, a 12-hour journey.

“There are challenges ahead of us, including uniting Libyans and healing divisions,” he said after arriving. “Young people are the ones we must bet on for Libya’s future.”

The unity government emerged from a UN-mediated deal signed in December aimed at ending the country’s political impasse, resolving its armed conflict and tackling a growing threat from jihadist group Islamic State (IS).

Western powers have recognised it as Libya’s sole legitimate government, but it has faced continuing opposition from hardliners in both eastern and western Libya.

Since 2014 Libya has had two competing parliaments and governments, both backed by loose alliances of armed brigades. The government in Tripoli was brought to power by armed factions that won a battle for control of the capital in 2014.

Tripoli, home to many armed factions, has seen sporadic clashes in the past few days. Early on Wednesday, loud explosions followed by heavy gunfire were heard in the city.

Ahead of its arrival, the council said it had negotiated a security plan with police and military forces in Tripoli, and with some armed groups.

The road outside the naval base was heavily secured with checkpoints and armoured vehicles on Wednesday. Security forces were also stationed inside the base, and some guards arrived with the council members.

The council has called for an immediate transfer of power to the unity government, but the Tripoli and eastern-based governments oppose this.

The unity government’s 18 members have so far failed to secure vote approval from Libya’s eastern, internationally recognised parliament, as required under the UN-mediated deal, and Fathi al-Mrimi, a spokesman for eastern parliament’s president, said its arrival was “premature”.

“They have entered by force under foreign protection, and Libyans won’t accept anything imposed on them by force,” he said.

UN Libya envoy Martin Kobler welcomed the council’s arrival, saying the international community was “ready to provide the required support and assistance”, and that all Libyan security actors had a responsibility to ensure its safety.