Three children were found dead inside the cabin of a pleasure boat that capsized off Long Island on Wednesday night as it was returning from a fireworks show celebrating the Fourth of July, the Nassau County police said Thursday morning.


The police said 24 of the 27 people onboard were rescued, but divers found the bodies of a boy and two girls inside the cabin as the boat sank near Oyster Bay, N.Y. The children were identified as David Aurelino, 12, Harley Treanor, 11, and Victoria Gaines, 8. They all lived in Suffolk County.


The police were investigating whether the 34-foot yacht, one of more than 100 boats on the water after dark on the holiday, was overcrowded or if the weather or a wake from a nearby boat could have been factors. They would not say whether the children recovered from the cabin were wearing life jackets.


Boat operators are required to have a life jacket onboard for every passenger, and children under the age of 12 are required to wear them at all times unless they are inside a cabin, the police said.


The first emergency call to 911 about the boat was received at 10:10 p.m.


A diver from a volunteer rescue squad pulled one of the bodies from the cabin, but conditions under water as the boat drifted were too hazardous for him to return for the other children, the police said. Other divers later located the bodies of the other two.


The boat drifted more than half a mile and was about 60 feet below the surface as crews worked to recover it in the morning, the police said.


The boat sank about three miles offshore, off of Cove Neck not far from Cold Spring Harbor, said Vincent Garcia, a spokesman for the Nassau County police. “It apparently sank fast,” he said.


The three victims were all related, but he was not sure how, Mr. Garcia said, adding that everyone aboard the boat were friends and family members.


With the area filled with vessels, other boaters responded quickly to the capsizing. A man driving a speedboat was one of the first on the scene, rescuing about 20 people, according to Justin McCaffrey, the public safety commissioner for Oyster Bay.


Other rescue vessels were launched from Theodore Roosevelt Memorial Park in Oyster Bay and the Seawanhaka Corinthian Yacht Club across the water on Centre Island. One man visiting the yacht club on Thursday, Bruce Lebens, said he was suspicious about the number of people aboard the capsized boat.


“That’s too many people on a 34-foot boat," Mr. Lebens said.


There are no federal regulations governing the capacity of boats of the size like the one that capsized, according to the Coast Guard.


The fireworks show that filled the waters was sponsored by the Dolan family, which operates Cablevision Systems, which includes the cable television and telecommunications system, and the Madison Square Garden Company, which owns Madison Square Garden, Radio City Music Hall, the New York Knicks and the New York Rangers.


The investigation into the accident is being led by the Nassau County Police Department with the help of the Coast Guard and other agencies.