Four times last week, speedboats belonging to Iran's Islamic Revolutionary Guard Corps – a sort of government-sanctioned Islamic militia – harassed four American vessels patrolling the Persian Gulf.

The U.S. Navy patrol craft USS Squall (PC 7) steams in the Arabian Gulf in this U.S. Navy picture taken January 14, 2015. U.S. Navy/Mass Communication Specialist 2nd Class Anthony R. Martinez/Handout via Reuters

The incidents, while tense, ended bloodlessly. Still, they offered a glimpse into the kinds of methods Tehran could employ to potentially devastating effect during a shooting war.

Outgunned by the United States' much larger and more sophisticated weaponry, Iran's troops have, for decades, honed so-called "swarm tactics" that could reduce America's technological advantage.

MORE FROM REUTERS:

EU draws angry rebukes from Washington after Apple ruling

China charges U.S. woman with espionage

Instead of trying to match the U.S. military weapon-for-weapon, Iran deploys large numbers of relatively unsophisticated systems on land, at sea and in the air. The idea is to overwhelm American forces, much in the way a single bee is a nuisance to a human being but a swarm of them could prove lethal.

The Pentagon is well aware of the danger Iran’s swarms pose, however, and is devising new weapons to counter them, including small, precision-guided rockets and even lasers.

The August incidents came just hours apart. On August 23, four armed Iranian patrol boats sped to within 300 yards of the destroyer USS Nitze near the Strait of Hormuz. The 505-foot-long missile-armed destroyer fired off flares as a warning, and the Iranian boats withdrew.

A day later, three similar boats sailed tight circles around the U.S. patrol vessels USS Tempest and USS Squall. One Iranian boat sped toward Tempest on a collision course, which compelled Squall to fire warning shots with a heavy machine gun.

The Iranian boats withdrew only to return later the same day and harass the destroyer USS Stout. A few hours later, an Iranian boat played chicken with Tempest by speeding head-on toward it.

The U.S. Navy was apoplectic about the encounter with Tempest, in particular. “This situation presented a drastically increased risk of collision, and the Iranian vessel refused to safely maneuver in accordance with internationally recognized maritime rules of the road, despite several requests and warnings via radio, and visual and audible warnings from both U.S. ships,” said Commander Bill Urban, the U.S. Fifth Fleet spokesman.

This is hardly the first time Iranian speedboats have clashed – or nearly clashed – with American ships. In July, five Iranian boats came within 500 yards of the amphibious assault ship USS New Orleans. On August 15, Iranian boats launched rockets while conducting training exercises just a few miles from two U.S. ships. In 2015, Revolutionary Guard craft blew up a large target vessel that Tehran had built to mimic a U.S. aircraft carrier.

Similar incidents have occurred regularly for decades, and indeed have come to represent Iran’s main method of provocation in the Persian Gulf and beyond. The Islamic Revolutionary Guard Corps employs swarm tactics in the air and on the ground, too.

The guard corps has bought scores of small, low-flying aircraft that it apparently hopes can overwhelm enemy defenses.

Its tactics complement those of the mainstream Iranian military. The Iranian navy, not to be confused with the guard corps’ naval arm, conserves its meager resources – large missile-armed warships -- for infrequent, long-range deployments to distant waters, in recent years hailing at Syrian and Chinese ports.

The navy’s cruisers serve a mostly diplomatic function. In a sense, the navy is the good cop in Iran’s at-sea dealings with other countries. The Islamic Revolutionary Guard Corps, meanwhile, plays the bad cop, which adds an element of uncertainty to the Persian Gulf that helps to keep Tehran’s rivals off balance.

But the United States isn’t just rolling over in the face of the guard corps’ naval harassment. Historically, the U.S. Navy has trained and equipped its forces for battles with other well-armed navies also operating their own large warships. Its main weapons for such battles are large, multimillion-dollar cruise missiles, of which most ships can only carry a few. The threat from large numbers of nimble, inexpensive guard corps speedboats compelled the Americans to think differently.

In the 1980s, the Navy began bringing U.S. Army attack helicopters aboard some of its ships in the Persian Gulf. The Army copters’ missiles and guns were ideal for blasting Iranian boats. In 1988, U.S. and Iranian forces fought a brief, violent skirmish that damaged or destroyed several Iranian vessels.

The U.S. fleet began adding Army-style missiles to its own helicopters. And in 2012, the sailing branch went a step further when it finally fielded a custom-made guided rocket of its own that is specifically optimized for defeating swarms of boats. The Advanced Precision Kill Weapon System is a 2.75-inch-diameter rocket with a laser seeker.

Navy and Marine Corps helicopters, as well as other aircraft, can carry pods, with each containing up to seven of the rockets. The copter shines a laser on enemy boats, or other targets, then fires. Each APKWS rocket heads for a different boat, in essence swarming the swarm with tiny lethal munitions.

The guided-rocket system has a 95-percent hit rate, according to the military. "This will give the helicopters a potent capability against swarming fast inshore attack craft," noted Jane's, a defense trade publication.

And that's not all. In 2014, the U.S. Navy fitted a new, large laser gun to the amphibious ship USS Ponce, which is permanently stationed in the Persian Gulf, where it acts as an at-sea base for helicopters, small boats and special operations forces. Big, slow and otherwise lightly armed, Ponce was uniquely vulnerable to the guard corps boat swarms.

The so-called Laser Weapon System , aimed by an operator holding a video-game-style controller, shoots a 30-kilowatt laser over a distance of several miles. As LaWS doesn’t fire conventional missiles or bullets, instead drawing power from a generator, it essentially never runs out of ammunition. Perfect for wiping out a swarm.

The laser system is a one-off weapon – and, at $40 million, it didn’t come cheap. But having proved that a laser can work in real-world conditions, the Navy is planning to build more and bigger lasers and, potentially, outfit all its front-line warships with them. If that happens, the Islamic Revolutionary Guard Corps swarms might finally meet their match.