WASHINGTON — The US Navy is deploying a solid-state laser weapon to the Persian Gulf, a top Naval official disclosed Monday, saying the move was aimed at deterring Iran from using small boats to attack American warships.

Unveiling the plans to place the laser cannon aboard a US ship in the Persian Gulf, Admiral Jonathan Greenert, the US chief of naval operations, pointed out that Iranian attack boats have posed a worrisome challenge for the American military.

The $40 million system will be installed aboard the USS Ponce, an amphibious assault ship used in the Gulf for mine clearance and humanitarian operations.

While still in development, the laser system has succeeded in destroying all 12 of its drone and small boat targets in testing, officials said. To bolster its capabilities, the Navy released a video of the laser weapon setting an aerial drone aflame and forcing it to crash into the water.

“It’s kind of amazing,” Admiral Greenert said in announcing the deployment plans at a convention outside Washington, DC.

The Laser Weapon System uses directed energy to disable sensors or burn holes through a plane or ship. Because of its limited range, the weapon won’t be able to target incoming missiles or jets, but it could be effective in combating Iranian fast boats and any drones the Gulf nation is developing, officials said.

The Pentagon has struggled for years to develop effective laser weapons systems, including ones mounted on planes intended to shoot down missiles. The naval version, the first of its kind to be dispatched to the field, has more modest ambitions.

Military officials said the Persian Gulf was also an important testing ground because of its harsh physical environment. “If it can stand up to the weather and rugged nature it can do it anywhere,” said one navy official.

The US military is wary of the threat posed by small attack boats. In 2000, a small boat filled with explosives hit the USS Cole in Yemen, killing 17 sailors.

Last year, a US Navy supply ship opened fire on what was described as a fast-approaching boat off the United Arab Emirates coast. That craft turned out to be an Indian fishing boat, and the shooting killed an Indian fisherman. On Monday, the US Navy cleared the sailors of any wrongdoing in the incident and said that they had acted properly when they opened fire.