TRIPOLI, Libya -- NATO warplanes bombed Libyan naval vessels in three ports on Friday, leaving ships partially sunken and charred and showering docks with debris in the military alliance's broadest attack on Moammar Gadhafi's navy.

NATO said the overnight bombing runs were meant to protect the nearby rebel-held port of Misrata, the only major city in the western half of Libya that is under the control of the fighters trying to end Gadhafi's nearly 40-year rule. One of the attacks struck the main port of Tripoli, and reporters could see flames and smoke pouring up into the night sky from stricken vessels.

In a later tour of the area, journalists saw three partially submerged boats armed with missile launchers docked alongside one another. The blasts peeled away part of a gun turret. Altogether, eight coast guard boats and one docked frigate under repair were hit at the three ports, said Commandant Omran al-Forjani, head of Libya's coast guard.

At NATO headquarters in Brussels, the alliance confirmed its warplanes targeted the boats and accused Libya of using its ships in the escalating conflict, including attempts to mine the Misrata's harbor, a key lifeline to the besieged city. The other ports hit were in the city of Khoms, between Tripoli and Misrata, and in Sirte, farther east, Libyan officials said.

British Maj. Gen. John Lorimer, a NATO communications officer, said British warplanes hit two Libyan corvette warships in the Khoms harbor and "successfully targeted a facility in the dockyard constructing fast inflatable boats, which Libyan forces have used several times in their efforts to mine Misrata and attack vessels in the area."

He said the port was the nearest concentration of regime warships to the port of Misrata, which Gadhafi has repeatedly attempted to close to humanitarian shipping.

Rear Adm. Russell Harding, deputy commander of the NATO operation, said the Gadhafi regime was employing more ships in its campaign against rebel fighters.

"Given the escalating use of naval assets, NATO had no choice but to take decisive action to protect the civilian population of Libya and NATO forces at sea," he said.

Libya countered the claims, saying it has left its ships docked since a NATO warning at the end of March that they would be considered targets if they left port. "We were told if the boats moved, they would be hit," said al-Forjani at a press conference in a cafe by the Tripoli port.