Two boys in upstate New York were trapped under a seven-foot mound of snow for more than four hours before they were freed early Thursday by rescue workers and relatives who dug with their hands and shovels, the police said.

The boys, ages 9 and 11, had been playing in snow that had piled up in a parking lot opposite the apartment complex where they were staying on Wednesday evening in Newburgh, about 60 miles north of New York City in Orange County. While details remained sketchy Thursday night, Sgt. Aaron Weaver of the Newburgh City Police Department said the boys might have become trapped when a snowplow clearing the parking lot pushed the snow on top of them. The boys and the plow were on opposite sides of a snow mound, so it is likely that the plow’s operator did not see them, the police said.

The boys missed their 10 p.m. curfew, Sergeant Weaver said, and after checking around the neighborhood, their parents called the police just before midnight.

Brandon Rola, a police officer canvassing the area, found the boys around 2 a.m. when he noticed a shovel jutting out of a mound of snow. The officer began digging with the shovel and was joined by other officers, an ambulance crew and relatives who dug with their hands, Sergeant Weaver said.