Beaches in the Rockaways were ​closed for over four hours Tuesday afternoon due to shark sightings, according to the NYPD and the city's Department of Parks and Recreation.

Police say the beaches reopened for swimming Tuesday at 6 p.m. after closing just before 2 p.m. The boardwalk remained open during that time, the NYPD said.

During the four-hour closure, the NYPD conducted aerial surveillance of the shoreline as officials worked to determine when to reopen the beaches, according to the parks department.

The closures came as temperatures soared across the five boroughs.

As of Monday morning, there were reports of five shark attacks on coastal areas near Long Island in the last two weeks.

On Sunday, the east end of beaches in the Rockaways were closed for swimming for over two hours due to shark activity, the parks department said.

In response to shark sightings, Gov. Kathy Hochul announced Monday morning that New York officials would be stepping up shark monitoring efforts in coastal areas and beaches across Long Island.

Beach and shoreline patrols, plus drones for aerial surveillance, will be utilized to help detect sharks, Hochul said. The state Department of Environmental Conservation will also be monitoring and tracking schools of sharks.

"We need to keep our beaches safe," Hochul said Monday.