Two New York boys were rescued after being trapped under several feet of snow for hours after being buried by a snow plow on Wednesday, police said.

According to police, the 9 and 11-year-old were building a snow fort in a built-up mound in the parking lot of an apartment complex in Newburgh, NBC New York reports. A plow then came by and pushed more snow onto the pile, trapping the boys underneath.

Police added that the plow operator pushed up the snow on the opposite side of the mound and therefore was not able to see the boys playing.

The boys, who are cousins, were trapped for hours in the sub-freezing temperatures.

One of the boys' mothers went out looking for them when they didn't come home at around 10 p.m. She and other family members searched for the boys and then called the police to report them missing.

Officers canvased the apartment complex looking for the boys, interviewing neighbors and children in the area. They eventually learned that the cousins had been playing in the snow near the parking lot.

One officer found a shovel half-buried in the snow and immediately began digging. The officer called for help and a team of police, EMS workers and community members worked together to dig out the boys, eventually freeing both of them at around 2 a.m. Thursday. Both boys were still conscious and were taken to the hospital for cold exposure.

One of the officers on the scene, Sgt. Aaron Weaver, described the frantic scene as everyone tried to rescue the cousins.

"It was all just really adrenaline," Weaver said. "I wasn't thinking much. Just trying to get to the kids."

One of the boy's mothers posted a thank you to Newburgh Police on Instagram.

"Today I am thankful my son and nephew are here and I would like to thank the Newburgh Police Officers who found my nephew and my son after searching for them," she said Thursday according to NBC. "They found them at 2 a.m. stuck in a huge snow pile that trapped them for several hours so I am very thankful today to have these two safe at home alive."