The UN Support Mission in Libya said on Friday that its Tripoli headquarters had come under rocket attack without causing any casualties or damage.
The Libyan interior ministry said it foiled "an attempted attack" with an anti-tank missile on the compound housing UNSMIL headquarters.
The rocket hit a house in Janzour on the outskirts of the capital, the ministry added, without specifying how far that was from UNSMIL headquarters.
Authorities said they seized a pickup truck "carrying two more missiles and a launch platform" but gave no indication of who might have carried out the attack.
Rival administrations
In May, the capital was rocked by days of deadly fighting between rival armed groups that left at least eight people dead, according to UNSMIL.
The fighting broke out after authorities said they were dismantling armed groups.
UN facilities not impacted
The latest attack took place as UNSMIL chief Hanna Tetteh was briefing the Security Council in New York, the mission said.
"The mission's premises were not impacted," it said, commending "the vigilance of the Libyan authorities and their swift measures to thoroughly investigate this incident and ensure continued security of UN facilities".
The Tripoli-based government condemned what it called a "failed attempt" and a "serious act aimed at undermining security and stability and damaging Libya's relations with the international community".

The government also said it was committed to building "professional and unified security forces" and ending the proliferation of "illegal armed groups".