As he later told police, Harley Stowell picked the wrong time to have a few beers and drive his center console boat at high speed through Edgartown’s outer harbor. On that night last October, it was dark, visibility was reduced by intermittent rain, and there were police officers and a harbor master aboard patrol boats just a few hundred yards away.

Mr. Stowell sped past the small contingent of law enforcement assigned to safeguard a private fireworks display, narrowly missing the fireworks barge. One officer who heard the outboard engine thought it was an airplane. A few moments later, the officers heard a loud crash.

According to the police report, Mr. Stowell, 51, visiting from Manchester, struck a dock at the Chappaquiddick Beach Club. His vessel launched over the dock, ejecting him and a passenger, and came to rest 10 feet above the shoreline. He was later arrested at the Martha’s Vineyard Hospital following treatment for his injuries.

Operating under federal law, Coast Guard can board any vessel at will. — Steve Myrick

Mr. Stowell picked the right time to hit the dock. A few hours earlier or a few hours later, the tide would have been lower, and the boat might have gone under the dock, not over it. Police said the high tide very likely saved the two men’s lives.

Mr. Stowell was eventually acquitted of operating a boat under the influence of alcohol, but convicted of negligent operation of a boat following a bench trial in Edgartown district court. Because he refused a blood alcohol test at the time of his arrest, his driver’s license was initially suspended for 120 days, and reinstated following acquittal.

With the Fourth of July holiday and peak summer boating season under way, the U.S. Coast Guard, local police departments, and town harbor masters are pledging extra vigilance on the water, enforcing state laws to prevent life-threatening accidents.

“We understand people want to have a good time,” said Edgartown police Sgt. Michael Gazaille. “But we want them to be smart.”

On a recent day, a Coast Guard boarding crew operating a 29-foot response boat out of station Menemsha patrolled Vineyard Sound, where dozens of boaters were enjoying perfect weather and somewhat cooperative fish. Petty officers on patrol for drunken boaters operate very much like a police force patrolling roads. They are well trained, professional and always aware of the possibility of something going wrong. They are armed with side weapons, wear body armor, and carry breathalyzer equipment to detect blood alcohol level.

“Stay safe,” said petty officer Jerry Tingle, as he maneuvered toward a boat that would be the first boarding of the day. Petty officers Shaquille Reed and Mason Martin stepped aboard a small cabin cruiser with four people aboard fishing, and began a safety check. Petty officer Adam Smith stood guard aboard the response boat.

While much of the procedure is the same, there is a crucial difference for the Coast Guard, which operates under federal law. Unlike a police officer stopping a vehicle, the Coast Guard needs no probable cause to board a vessel in U.S. waters. The crew can board any vessel at will, under the authority of an act of Congress.

The boarding officers are friendly, even inviting the men to continue fishing while they check for personal flotation devices (PFDs) and safety equipment and observe the operator of the boat.

With paperwork completed, they come back aboard the Coast Guard boat.

“Zero, zero,” Petty Officer Tingle radios back to station Menemsha, meaning the boarding crew has found no violations and issued no warnings.

“The Fourth of July is one of our high peaks,” he said after patrols were done for the day, noting that summer holidays are times when the Coast Guard is especially watchful. Fireworks also require extra caution. “We do a safety zone for that, just to make sure nobody gets too close,” Petty Officer Tingle said. “If they are intoxicated, we can stop them before they actually get to the fireworks, prevent any mishaps.”

Edgartown police officers who patrol on the water as part of their duty work, receive training from the Coast Guard in boarding vessels and enforcing operating under the influence laws. Three new officers on the force completed their training this week.

“It covers some unique aspects for OUI on the water,” Sergeant Gazaille said. “You can’t give a field sobriety test on a boat, you have certain steps you have to go through to make sure they are afforded their rights.”

The laws and penalties for operating a boat under the influence of alcohol or drugs mostly mirror similar laws for operating a vehicle on a roadway.

The legal limit for blood alcohol is the same: 0.08 percent. Anyone who refuses a blood test will automatically have their driver’s license revoked for 120 days and their vessel registration revoked for the same period. If convicted, a minimum fine of $100 is imposed, usually in addition to court costs. The maximum penalty for a first offense is a $1,000 fine and two and a half years in a house of correction. For a second offense within six years, there is mandatory minimum sentence of 14 days in a house of correction. In most cases, a previous drunk driving conviction in a vehicle, or assignment to an alcohol education rehabilitation program, would count as a first offense for someone convicted of operating a boat under the influence. For a third offense within six years, the mandatory minimum sentence is six months of incarceration, and for a fourth offense within 10 years, the mandatory minimum is two and a half years of incarceration.

Nationwide, the Coast Guard lists alcohol abuse as the primary cause in 277 boating accidents, resulting in 108 fatalities.

In Massachusetts during the five years from 2010 to 2014, there were 39 boating accidents where alcohol abuse was the primary cause, resulting in 14 deaths.

Operating a vessel under the influence of alcohol is by far the leading cause of boating accident fatalities.

In some categories, the statistical trends are downward, which makes sense to Edgartown harbor master Charlie Blair. He sees fewer young people boating, and a lot more people with better ways to alert authorities.

“The public is our biggest ally on the Fourth of July,” Mr. Blair said. “People pick up a cell phone and call us. It’s getting better, because if they refuse the sobriety test, they lose their driver’s license.” But he has little tolerance for those who ignore the penalties. “We like to terminate their voyage, take them to the nearest dock and let 2-6-7 (the Edgartown police vessel call number) take over. It’s not that we’re looking for trouble. We’re looking to prevent trouble.”