Two men wandered onto the mudflats off Kalifornsky Beach Road in Kasilof late Thursday to take a picture of an eagle.

46-year-old John Prince of Arkansas and 47-year-old William Shannon of Indiana made it out 500 feet before they ended up getting stuck in the mud, according to the Alaska State Troopers.

The men were unable to self-extricate, but Central Emergency Services was able to dig them out by 12:30 a.m., just as the tide was rolling back in.

"Rescue personnel, with float suits and rescue equipment, made their way to the men," said CES spokesperson Brad Nelson. While one man was easy to get out, the other was stuck up to his waist and it took "an estimated 45 minutes just to free one leg."

Both men were checked by medical personnel on scene, but neither was transported to a hospital.