During the visit, the two countries' oil companies signed a gas deal worth around $8 billion (roughly €7.5 billion), calling it the largest single investment in Libya's energy sector in more than two decades.
Italy's ENI and the Libyan National Oil Corporation (NOC) plan to cooperate on the construction of two offshore gas fields off Libya's northern coast. ENI said in a statement that output would begin in 2026 and reach a plateau of 750 million cubic feet per day.
ENI CEO Claudio Descalzi and NOC chairman Farhat Begdara signed the deal at a ceremony also attended by Meloni and the head of Libya's UN-brokered but contested national unity government, Abdel Hamid Dbeibah.
"This agreement will enable important investments in Libya's energy sector, contributing to local development and job creation while strengthening ENI's role as a leading operator in the country," Descalzi said.
Meloni called the deal "significant and historic," saying "Libya is clearly for us a strategic economic partner."
But Saturday's deal showed rifts in the rival Libyan administrations in the east and west, as had previous oil deals between Tripoli and Ankara.
The rival government in the east considers the Tripoli government illegitimate and by extension the commercial deals it strikes with foreign states as well.
For most of the past decade, rival governments in Tripoli and in the east of the country have been vying for control since the NATO-backed uprising that ousted dictator Moammar Gadhafi.
But even within Dbeibah's government, Oil Minister Mohamed Aoun did not attend the signing ceremony on Saturday and criticized the deal as "illegal" on local television, saying that the NOC did not consult with his ministry.
The NOC's Bengdara did not address the criticism directly but said those who rejected the deal could challenge it in court.
Security tight, government's grip looser
Meloni landed at Mitiga airport, the only functioning airport in Tripoli at present, amid tight security. Her foreign and interior ministers, Antonio Tajani and Matteo Piantedosi, accompanied her.
She met with the leader of the UN-brokered government Dbeiba and held talks with Mohamed Younis Menfi, who chairs Libya's ceremonial presidential council.
Echoing comments she had made in Algeria, Meloni said that while Italy wanted to increase its presence in the region, it was not seeking a "predatory" role but rather wanted to help African nations "grow and become richer."
High-ranking diplomatic visits to Africa have been in sharp focus recently, not least as Russian Foreign Minister Sergey Lavrov made a pair of tours of the continent and as the US then sent a delegation of its own, with President Joe Biden planning to visit later.
Boats pledged to Libyan coast guard
Interior Minister Piantedosi's presence on the visit was seen as a nod to Meloni's other likely priority in Libya, migration.
The right-wing leader campaigned last year promising a tougher line on people arriving on Italian territory from Libya, often trafficked by people smugglers. In 2022, Italy recorded more than 100,000 migrant landings.
At a joint news conference with Meloni, Dbeibah said that Italy would provide Libya's coast guard with five "fully equipped" boats to help stem the flow of migrants to European shores.
Activist groups criticized the plan.
"While this is nothing new, it is worrying," the Alarm Phone rescue NGO said in a statement to the Associated Press. "This will inevitably lead to more people being abducted at sea and forced to return to places they had sought to escape from."
Why did so many Italian voters turn to Meloni and her party?