Eastern Libya's General Khalifa Haftar has ordered his forces to fire at any foreign ship that enters Libyan territorial waters, according to the Facebook page of Haftar's Libyan National Army.
The statement came after Italy began a limited naval mission on Wednesday to help Libya's coast guard curb migrant flows, which have become a source of political friction before national elections expected early next year.
Italy announced the operation last week, saying it had been requested by Libya's UN-backed government.
The move triggered irate statements from factions in eastern Libya that oppose the UN-backed government.
An eastern-based parliament warned against "attempts by Italy ... to return tens of thousands of illegal immigrants to Libya."
Haftar, a powerful military commander aligned with the chamber, ordered his forces to repel "any naval vessel that enters national waters without permission from the army."
The move was also seen by some as an infringement on Libya's sovereignty.
In Tripoli, a poster of resistance hero Omar al Mukhtar, who battled Italian rule in Libya in the 1920s, was hung near the capital's main square with the inscription "No to a return to colonisation."
"There will be no harm done or slight given to Libyan sovereignty, because, if anything, our aim is to strengthen Libyan sovereignty," Italian Defence Minister Roberta Pinotti told parliament on Wednesday, stressing that Italy had no intention of imposing a blockade on Libya's coast.
Pressure on NGOs
Rome has also put pressure on non-governmental organisations that have played an increasingly important role in picking up migrants off the Libyan coast and bringing them to Italy.
The government has introduced a code of conduct for the NGOs after prosecutors in Sicily alleged that some non-governmental organisations had been colluding with the smugglers who send boatloads of migrants out daily from Libya, for example by signalling their presence in one area of the sea.
Groups including Save the Children and Doctors Without Borders denied the allegations, and said the claims undermined their humanitarian work by creating a climate of mistrust.
At least three groups accepted the Italian government's rules and the EU is encouraging more to sign up.
The Human Rights Watch (HRW) group said Italy's move may endanger migrants.
"After years of saving lives at sea, Italy is preparing to help Libyan forces who are known to detain people in conditions that expose them to a real risk of torture, sexual violence, and forced labour," HRW said in a statement.
Objections to the Italian demands include a provision that would permit armed police on the rescue ships. Several non-governmental groups strenuously oppose having weapons on the ships at any time, saying guns and humanitarian operations are incompatible.
Italian authorities say the rules are necessary to ensure the boats are not effectively encouraging migrants to embark on the perilous crossing.
The Italian government has also said humanitarian groups who do not agree to the new rules could be refused access to Italian ports.
But it seems unlikely that Italy could deprive them of access to its ports. Under international law, vessels that have rescued people must not be subject to undue delay, financial burden or other difficulties, according to the UN's refugee agency.