The bodies of 36 people shot dead have been found near Benghazi, in eastern Libya, a security official said Sunday.
The bodies, found in Al-Abyar, around 70 kilometres (45 miles) east of Benghazi, were of suspected Islamist militants including 19 foreigners, the official said.
The United Nations mission in Libya said it "condemns in the strongest terms the heinous crime resulting in the killing of at least 36" people.
It called for an immediate investigation to bring the perpetrators to justice.
Controversial strongman Khalifa Haftar, whose self-proclaimed Libyan National Army controls the region, ordered an enquiry to find their killers, the pro-Haftar LANA news agency reported.
In Tripoli, a national unity government opposed to an eastern administration backed by Haftar called the killings a "heinous crime and a horrible act," and said it would also launch an investigation.
Fighters in Haftar's LNA, which has battled jihadist groups since 2014, have in the past been accused of involvement in summary executions of detained Islamist militants.
LANA said Haftar's probe would seek to uncover whether those killed were detained at the time.
In August, the International Criminal Court issued called for the arrest of a senior commander in an elite force fighting alongside Haftar's LNA.
The officer, Mahmoud Mustafa Busayf al-Werfalli, is accused of war crimes over at least seven incidents in 2016 and 2017.
Werfalli's brigade was involved in a three-year battle to rid Benghazi, Libya's second-largest city, of jihadists.
ICC judges allege he personally shot or ordered the execution of people who were either civilians or injured fighters.
They say he was behind 33 execution-style killings there.
Haftar's forces said he was already under arrest and would be tried by a military court.
Libya has been ripped apart by conflicts between multiple militias and two rival governments.