The blaze erupted at the wooden Mariner's Cover Motor Inn in this popular summer resort town at around 5:30 a.m., and flames were shooting out the building by the time firefighters arrived. At least one person leaped from a second-floor window to escape.
Three people were injured critically. Other injuries included broken bones.
The discovery of a fourth victim was announced Friday afternoon just before firefighters removed the body on a stretcher. Authorities said all remaining occupants had been accounted for.
The victims were identified as male adults, but the prosecutor's office said no positive identifications had been made yet and the cause of the blaze was unknown.
Investigators interviewed motel management, and determined about 40 people were staying there when the fire broke out, Ocean County Prosecutor Joseph Coronato said. The motel's office was destroyed and many records were lost, he said, making an accurate accounting difficult.
Firefighters climbed ladders to reach charred second-floor units and search through them. An aerial ladder was also used to maneuver a firefighter into position to peer into burned rooms.
Survivors described a chaotic scene of flames, smoke and screaming.
Peter Kuch said he smelled smoke and opened his door to find a lounge area engulfed in flames. He dialed 911 to seek help, and by the time the call was completed, the flames were at his door and licking at the windows of his second-floor unit.
He decided to jump.
"I had to, there was no other way out," he said. "My window was only open an inch and flames were already starting to come through it. There just was no other choice."
He suffered a sprained ankle but said he was otherwise all right.
Joe Frystock was one of the Sandy victims who was staying at the motel, which like many others in this resort, relies on people seeking low-cost rentals during the slow winter season. His home in nearby Brick Township took on 6 feet of water during the October 2012 storm, and the motel was the latest in a series of temporary homes for him.
Frystock, who is diabetic, said he frequently has to use the bathroom at night. He woke up to popping sounds, which he initially thought was gunfire.
"It was the sound of timbers burning upstairs," he said. "I looked out and saw that orange glow, and there was no mistaking what it was. People were yelling: 'Help me! Help me!' There was lots of screaming. A woman in the unit next to me, they pulled her from a bathtub, but I don't know how anyone could have survived those flames. The entire second floor was engulfed, from one end to another."
That woman, who had sought refuge in a shower and kept the water running while waiting to be rescued, was pulled from the bathroom by one firefighter, who handed her out a window to another firefighter, who carried her down a ladder to safety. The woman was taken to St. Barnabas Medical Center, a hospital about an hour north that specializes in treating severe burns, which Coronato said she had suffered.
Denise Dougherty, the motel's housekeeper, said she was awakened by screams.
"There were people yelling, 'Help me! Help me!' and other people yelling, 'Jump! Jump!' It was terrible."
Shawn Wardell said a strong wind was fanning the flames across the second floor of the motel, where he had been staying with his cousin and grandparents.
"We got my grandfather out 'cause he's disabled, and by that time the whole second floor was just engulfed in flames," he said. "People were yelling and screaming."
Residents gave conflicting accounts of whether they heard smoke detectors or fire alarms sounding. Some said they heard nothing, while others said a fire alarm was blaring as the flames were sweeping eastward across the top of the building.
The Ocean County Sheriff's Department said one of the injured included one of its detectives, who suffered a severe leg injury, including broken bones, at the fire scene.