After being adrift and off course for months in the Pacific Ocean, two women and their two dogs were rescued Wednesday by Sasebo-based amphibious dock landing ship USS Ashland (LSD-48).

Jennifer Appel and Tasha Fuiaba, both from Honolulu, had set out from Hawaii in the spring, planning to reach Tahiti after a few weeks at sea. On May 30, bad weather knocked out their sailboat’s engine, according to a statement released by the Navy. Appel and Fuiaba decided to continue onto their destination under wind power.

After two months at sea, long past their intended arrival in Tahiti and hundreds of miles off course, Appel and Fuiaba started issuing daily distress calls. By this point, though, they had drifted far from routine shipping lanes or any shore stations which could receive these calls, according to a Navy statement.

On Tuesday, a Taiwanese fishing vessel found Appel and Fuiaba about 900 miles southeast of Japan. The fishing vessel contacted Coast Guard Sector Guam, which coordinated with Japanese, Taiwanese, and U.S. authorities.

Wednesday morning, Appel and Fuiaba spotted Ashland on the horizon, and knew soon they’d be rescued.

“I’m grateful for their service to our country. They saved our lives. The pride and smiles we had when we saw [U.S. Navy] on the horizon was pure relief,” said a statement released by Appel.

Ashland was performing routine operations in the area, and was the closest ship to provide assistance. After determining Appel and Fuiaba’s sailboat was not seaworthy, the women and their dogs were brought aboard. They’ll stay with Ashland until it’s next scheduled port call.

Once on Ashland, Appel, Fuiaba, and the dogs were provided berthing, medical assessments, and meals. The women and dogs survived their months at sea thanks to having water purifiers onboard and having brought a year’s worth of food. Most of their meals for the past several months included oatmeal, pasta, and rice, according to a Navy statement.