It happened in the Great South Bay in Sayville Monday.
Authorities say Sarah Thalhammer followed a 1-year-old poodle/Maltese mix onto the ice when she fell into the water at the end of Candee Avenue.
When Officer Matthew DeMatteo arrived, he crawled on the ice to reach the girl.
Sarah was approximately 50 yards offshore in about four feet of water, officials said.
DeMatteo pulled the girl, who was unable to move, from the water and headed back to shore on the ice.
Then the two fell through the ice again.
Chris Gonzales, the First Assistant Chief of the Sayville Community Ambulance, tossed a rope to them and was able to pull them to shore.
DeMatteo and Thalhammer were transported to Stony Brook University Medical Center for treatment.
The dog, named Ace, was rescued by fire department personnel.