All the 24 crew members of an overturned cargo ship that caught fire off the Georgia coast over the weekend have been rescued, with the final four pulled out after being trapped for more than a day, the U.S. Coast Guard said Monday evening.

Amid the initial chaos before sunrise Sunday, the Coast Guard was able to rescue 20 of the 24 people on board the Golden Ray, a 656-foot ship that was leaving the Port of Brunswick in St. Simons Sound with 4,000 vehicles when it listed to one side and tipped over.

But the fire on board, as well as the instability of the Golden Ray’s cargo, made conditions too risky for additional rescue missions until Monday.

Rescuers clapped and cheered as the final man emerged from the ship, climbing up a ladder while secured with ropes in a video the Coast Guard posted to Twitter.

“Operations will now shift fully to environmental protection, removing the vessel and resuming commerce,” the Coast Guard’s Seventh District tweeted after announcing that the last four South Korean members of the crew were safe.

On Tuesday, with the rescue operation complete, the Coast Guard said its crews had “shifted focus to environmental protection and working w/salvage crews to remove the #GoldenRay. Currently no leaks from the vessel, only a light residual sheen. Protective measures were put in to place after the initial rescue.”

The ship had 10 South Korean and 13 Filipino crew members and an American pilot, the Associated Press reported, citing South Korea’s Foreign Ministry.

The Golden Ray is owned by South Korean firm Hyundai Glovis, the AP reported.

The Coast Guard and port partners search for crew members on Sunday after the 656-foot vehicle carrier Golden Ray overturned in the St. Simons Sound near Brunswick, Ga. (U.S. Coast Guard/AFP) (Handout/AFP/Getty Images)

On Monday afternoon, the Coast Guard rescued three more people, but a final crew member was stuck behind glass in an engineering control room.

Coast Guard Sector Charleston’s Capt. John Reed said the three rescued crew members, who were receiving medical care and in “relatively good” shape, spent about 35 hours trapped amid temperatures that Reed said were “a lot hotter” than the 120-plus degrees teams experienced outside the vessel, which was smoking and had visible flames as rescuers arrived. Two were able to crawl out of the ship onto a boat, Reed said.

Authorities made the rescue after hearing “tapbacks” from the trapped crew throughout the night — signs of life that gave officials new motivation and helped them pinpoint the crew’s location on the large ship, according to Reed.

“Knowing that the people were alive made all the difference,” Reed said.

The South Koreans were in a propeller shaft room near the ship’s stern, Coast Guard Lt. Lloyd Heflin told the AP.

Complicating matters was the lack of power aboard the ship and its maze of compartments and watertight doors, Coast Guard Petty Officer 1st Class Luke Clayton told CNN. And a language barrier made it difficult for the initial rescue team to communicate with the trapped crew members, Heflin told the AP. But Reed said Monday afternoon that an engineer was able to speak with them in Korean.

Teams drilled a two-by-three-feet hole in three-inch increments and were able to pass food and fresh water to the three crew members rescued Monday afternoon, according to the Coast Guard.

Reed said authorities are still working to address ongoing threats to the environment and the Port of Brunswick near the overturned ship.

Coast Guard crews and port partners respond to an overturned cargo vessel with a fire on board Sunday in St. Simons Sound near Brunswick, Ga. (U.S. Coast Guard/AP)

The 20 people initially evacuated from the ship — 19 crew members and a U.S. harbor pilot — were lifted from the tilting ship by helicopter and lowered into boats using fire hoses, officials told CNN.

The National Transportation Safety Board said two of its investigators have been assigned to review the circumstances that led to the ship overturning.

A U.S. Coast Guard helicopter hovers over the ship Monday. (U.S. Coast Guard/AP)

Read more:

A man live-streamed his traffic stop. He recorded police fatally shooting him.

NOAA’s chief scientist will investigate why agency backed Trump over its experts on Dorian, email shows

Air Force reviewing layover guidelines amid scrutiny of stop at Trump property in Scotland