Almost two centuries ago, 134 men set sail on two British naval ships to discover the fabled Northwest Passage, a trade route through the Arctic linking Europe to the riches of the East. They never returned. The Inuit, native residents of the North, tell tales of the three-masted ships caught in ice and of men afflicted by scurvy and going hungry, until finally they broke the biggest taboo of humankind — cannibalism.

Despite search efforts, neither ship was found.

It was not until 2014 that the first traces of the expedition emerged, when divers located a shipwreck that they identified as HMS Erebus, named after the spiritual limbo between Earth and hell.

In October, the second big piece of the mystery fell into place when an Inuit ranger and a team of explorers announced that they had located HMS Terror — in near-pristine condition, not far from the Erebus — at the bottom of the Northwest Passage.

The story of the ships' loss and eventual finding reveals how much the Arctic, and our relationship with this frontier, has changed in a few decades.

The ice is no longer what it once was; scientists think that the Arctic will be reliably ice-free and navigable in the summer by the middle of the century, if not earlier. A cruise ship carrying more than 1,000 tourists traversed the northern ocean of North America for the first time this year.

The conditions today are balmy in comparison to what the expeditioners faced in the middle of the 19th century, at the height of the British Empire. The admiralty asked John Franklin, a 59-year-old polar explorer, to find a northern sea path linking the Atlantic and Pacific oceans.

Franklin knew how to navigate through ice, said Tom Zagon, a physical scientist with Canadian Ice Services.

He chose two military vessels — the Erebus and the Terror — for the journey and reinforced their hulls with iron to withstand the crushing force of ice. He filled his hold with three years' worth of canned food in case the voyage took longer than the expected two years.

On May 19, 1845, Erebus and Terror, both painted a menacing black with a yellow stripe, set off down the River Thames and into the Atlantic Ocean. Londoners thronged the banks and cheered the might of their empire. Success seemed assured.

But Franklin was heading into a frontier that science had not mastered.

Compasses did not work because their magnetic readings were impaired by proximity to the North Pole. There were no weather reports. It was much colder than today, and there were years with no summer ice melt at all, said Ryan Harris, an underwater archaeologist at Parks Canada. Ships can quickly get trapped in cement-like ice, he said.

The expedition entered the Arctic Ocean before the end of May and picked through the labyrinth of the Canadian Arctic archipelago. Franklin and his men reached as far north as 77 degrees, about 850 miles from the North Pole, before wintering on a tiny uninhabited island. The sea ice must have been unusually light for the ships to get that far north, Zagon said.

The landscape there is flat and desolate, with storms bringing 60-miles-per-hour icy winds from the North Pole. There is almost no wildlife, and the only flora are stubborn Arctic mosses that cling to black rocks littering the frozen ground. The region is vast; even today, only 10 percent of the Canadian Arctic has been mapped.

The only way to survive is by listening to the Inuit, said Adrian Schimnowski, chief executive of the Arctic Research Foundation, who spends five months every year in the North.

“When the Inuit give you advice on weather, hunting grounds, the best route to take to get somewhere, I follow 100 percent what they say,” he said. “They know the land better than anyone else.”

Inuit oral history suggests that Franklin and his men, however, did not consult with them. In September 1846, the British made a fateful decision to sail through a dangerous channel, the Victoria Strait. The strait is only 200 miles from the Canadian mainland, and yet it experiences heavier ice conditions than areas farther north, Zagon said.

Zagon thinks a storm crept up on the expedition, icing Victoria Strait within hours and trapping the ships. The men huddled onboard for two years, waiting for the ice to clear.

But even in summer, it remained unyielding, said Edward Carmack an emeritus oceanographer with the Institute of Ocean Sciences in British Columbia. Two dozen men, including Franklin, died of illness.

The remaining men abandoned the ships on April 22, 1848, in a mad effort to walk south, across King William Island, to the Canadian mainland. In biting winds, it took them three days to trek across the 15 miles of ice to the island. We know this because five years later, a note written by Erebus' commander was found under a stone landmark on the island.

Search parties dispatched from Britain did not find the ships or any survivors, but the Inuit told them of having seen men starving, their faces blackened possibly by scurvy. The survivors ate their comrades after boiling body parts in their boots, the Inuit said.

The oral history seemed to be confirmed in 2014 when scientists examined human remains from King William Island and found hack marks apparently left on skeletal remains by desperate butchers.

Franklin's ships had been considered lost to history. But in the 2000s, as the summer sea ice began to clear because of global warming, nations jostled to access the Arctic's riches.

In 2008, Canada began searching for the Erebus and the Terror as one way to prove a centuries-long link to the North.

In 2014, the Erebus showed up on sonar. Divers examined it and found a nearly intact ship.

A second breakthrough came in September, when Sammy Kogvik, an Inuit ranger who lives in Gjoa Haven, the only settlement on King William Island, boarded an Arctic Research Foundation vessel, where he told Schimnowski an odd story: Seven winters ago, he and a friend had been snowmobiling off King William Island, on the secluded and frozen Terror Bay, when they saw a pole sticking out of the ice. They went closer and saw that it was a six-foot-tall wooden mast. Kogvik wrapped his arms and legs around it and hung off it while his friend snapped a photo.

But Kogvik lost the camera during the trip and never told anyone about the incident, although he had thought of Franklin's doomed expedition.

Schimnowski set course for Terror Bay, which was ice-free this past summer. His team used a side-scan sonar, which images the ocean floor, to peer through the turbid waters.

As they were about to give up, they passed over an ancient three-masted ship at the bottom of the ocean, 80 miles north of the Erebus. Divers examined the ship a week later and confirmed that it is the Terror. The ship is tightly sealed and probably contains documents and other artifacts in pristine condition.

Scientists say it is doubtful that the Erebus and the Terror would have been found if they had been hidden under the ice common during Franklin's time.

“These were trained men, and they didn't just sit on the boat and starve to death,” Carmack said. “They looked for ways out. What was the trail of death, and what will we uncover to complete the story of that survival epic?”