Two American sailors and their two dogs were rescued Wednesday after surviving five months at sea in the Pacific after their sailboat's engine failed in May.

The U.S. Navy says Jennifer Appel and Tasha Fuiaba were discovered 900 miles southeast of Japan on Tuesday by a fishing ship from Taiwan. The USS Ashland, an amphibious landing ship, was in the area on routine patrol and assisted in the rescue effort.

Appel and Fuiaba set sail from Hawaii to Tahiti in the spring with their dogs, one of which is named Zeus. They said the vessel's engine died during bad weather on May 30, but the pair believed they could make it to land using the ship's sails.

Get Breaking News Delivered to Your Inbox

After two months at sea, the sailors said they began issuing daily distress signals, but there were no ships close enough to hear the calls. The ship drifted far off its original course after the engine failed.

Appel said they survived thanks to water purifiers and a year's supply of dry food on board, including rice, pasta and oatmeal, according to the Navy.

Sailors help Zeus board the USS Ashland. U.S. Navy / Mass Communication Specialist 3rd Class Jonathan Clay

The USS Ashland rescued the pair and their dogs several hours after locating their vessel on Thursday. They will remain on board until the Ashland makes its next port of call.

Appel thanked the Navy for coming to their rescue.

"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," Appel said, according to the Navy.