Libyan forces loyal to Moammar Gaddafi tried to sow anti-ship mines in the Misurata harbor Friday but were driven back by the threat of a NATO attack, the alliance announced.

Brig. Gen. Rob Weighill, in a NATO briefing streamed over the Internet, said the four Libyan vessels were dropping mines to make the port unsafe for ships delivering humanitarian aid to the besieged city and ferrying out Libyans and foreigners stranded by the fighting.

Misurata, on the Mediterranean coast about 130 miles east of Tripoli, has been under attack for weeks by the Libyan army and irregular forces loyal to Gaddafi. With the city surrounded on three sides, the port has become a lifeline for military supplies, aid and travel to and from rebel headquarters in Benghazi to the east.

In recent days, Gaddafi’s forces have shelled the port area relentlessly. Earlier this week, they tried to punch through rebel lines and occupy the facilities, which would have been a blow to the rebels’ effort to retain control of the central city. But they were driven back to their positions on the outskirts of town after a NATO airstrike destroyed a column of four-wheel-drive vehicles,

Weighill, keeping to NATO’s persistent stand, portrayed the Libyan army’s attempt to lay the mines as an attack on civilians in need of aid, setting aside the fact that rebel military supplies also arrive through the port.

“This is another demonstration of Gaddafi trying to completely ignore humanitarian law,” Weighill said, speaking from the Naples headquarters of Operation Unified Protector.

In the same vein, he accused Gaddafi’s government of violating international law by crippling Misurata’s sewage system and a desalinization plant during weeks of shelling and rocket fire by loyalist troops. The damage caused a shortage of drinking water and unsanitary conditions in civilian homes.

Weighill said he had no details on the NATO strike that halted Friday’s mine-laying operation, which he said happened in the late morning. The incident was the first known attempt by Libyan loyalist forces to mine the area, which is heavily patrolled by NATO vessels enforcing a U.N. arms embargo and watching over delivery of humanitarian supplies by foreign nongovernmental organizations.