Edward Allcard and Clare Thompson, whom he later married, in New Zealand in 1969. Mr. Allcard was the first sailor to cross the Atlantic Ocean alone in both directions. (Family photo)

Sailing alone aboard a 35-foot yacht, a wooden ketch named the Temptress, Edward Allcard crossed the Atlantic Ocean — traveling from Europe to New York and back — using only the stars and a sextant, surviving on packaged water and meager rations of canned food, cubes of bouillon and the occasional potato.

Mr. Allcard’s two-part voyage, which came to an end when he tied up at Plymouth, England, on July 13, 1951, made him the first person to single-handedly sail both directions across the Atlantic.

He was pursued by sharks, was nearly shipwrecked by a hurricane and became an international celebrity when he landed in Casablanca with a stowaway, a 23-year-old Azorean woman who had sought passage to England to become a poet.

Yet in a life at sea that spanned more than seven decades, Mr. Allcard surpassed his Atlantic expedition with a solo journey around the world. His slow-paced, 16-year voyage included a 12-month exploration of the treacherous waters off Patagonia, in South America, and — after taking time off to meet the woman who became his wife — the birth of his second daughter.

Mr. Allcard, a thick-bearded adventurer whom Boating magazine once described as “the dean of loners,” died July 28 at a hospital near his home in Andorra, a landlocked country in the Pyrenees, where he eventually traded sailing for skiing. He was 102, had sailed until he was 91 and continued writing memoirs of his seafaring life until shortly before his death, publishing “Solo Around Cape Horn and Beyond” in 2016.

Edward Allcard, center, with fellow sailors Norman Fowler and Ann Davison in 1952. (PA Images/Getty Images)

The cause was complications from a broken leg, said his wife, Clare Allcard.

Mr. Allcard was considered the last surviving member of what sailing historian John Rousmaniere has called the “Ulysses generation,” a group of men and women who took to the sea — often alone — in the aftermath of World War II.

Sailors such as Mr. Allcard, his friend Peter Tangvald and the Canadian couple Miles and Beryl Smeeton “were genuine sea gypsies,” said John Kretschmer, a writer and blue-water sailor. “But they were in search of something different from just beautiful or tropical things. They were in search of profound individual experience and willing to risk their life in pursuit of it.”

Mr. Allcard, who once described sailing as “practically a religion,” was 6 when he learned to sail and 23 when his boat sank off the coast of Ireland, forcing him to swim to shore. As on later voyages, he had no life raft or emergency radio with which to call for help.

He completed his first major solo sailing trip, from Scotland to Norway, in 1939 and a decade later embarked on his transatlantic expedition. It took him 81 days to travel from Gibraltar, at the southern tip of Spain, to New York.

It was an astonishingly slow cruise by modern standards but undertaken without the kind of automatic self-steering system that enabled French sailor Thomas Coville, crossing the Atlantic last month in a record-setting four days and 11 hours, to sail through the night with ease.

Mr. Allcard recalled the trip in a pair of popular memoirs, “Single-Handed Passage” (1950) and “Temptress Returns” (1952), which chronicled his tumultuous return journey, including a hurricane near the Azores and his subsequent discovery of the stowaway Otilia Frayão.

The woman, described by one newspaper as a “raven-haired Portuguese poetess,” had offered to help Mr. Allcard clean his boat when he landed in the Azores and hid inside the hold just before the moment of departure. He discovered her two days later, technically spoiling what was intended to be a single-person journey.

Edward Cecil Allcard was born in Walton-on-Thames, a London suburb, on Oct. 31, 1914. His father was a stockbroker and collegiate rower, and a grandfather encouraged an early interest in sailing, eventually giving him his first boat.

“When I was young I liked long walks alone in the country, and with sailing you just take the house with you,” Mr. Allcard once told London’s Sunday Express newspaper.

He graduated from Eton College and worked as a naval architect in Scotland, designing air-sea rescue craft during World War II. Poor vision kept him from serving in combat, he said, though it failed to keep him off the water.

Mr. Allcard’s solo journey around the world, a less-direct version of the trip that Joshua Slocum pioneered in the late 1890s, began with a race against Tangvald. Mr. Allcard, aboard a 36-foot ketch he named the Sea Wanderer, lost the 2,800-mile race from the Canary Islands to Antigua by two days. Tangvald, for his efforts, won an agreed-upon prize of $1.

When Tangvald died in a shipwreck in 1991, Mr. Allcard became the foster father to Tangvald’s 15-year-old son, Thomas. The younger Tangvald was declared lost at sea in 2014.

Mr. Allcard’s circumnavigation was highlighted by a rare westbound trip around Cape Horn, through a region that the sailor and writer Charles Doane described as having “the worst weather in the world.”

While rounding the horn, Mr. Allcard later wrote, he faced “quite the roughest ride of my life,” a storm that led him to tie himself to the wheel: “Without the lashing I would have been immediately catapulted overboard. Blisters over two inches across formed on my backside; but we were winning.”

He eventually untied himself, he wrote, to take photos of killer whales that began following his boat.

Mr. Allcard was at sea when he received a fan letter from Clare Thompson, an Englishwoman some 30 years his junior. They eventually married in 1973, after Mr. Allcard finished his trip around the world, and settled down in a relatively roomy 69-foot trading vessel, the Johanne Regina, before moving to Andorra.

A previous marriage ended in divorce.

Additional survivors include a daughter from his first marriage, Dona Mackereth of Settrington, England; a daughter from his second marriage, Kate Krabel of Whitehorse, Canada; four grandchildren; and one great-grandson.

Mr. Allcard at times expressed wonder at the forces driving him to travel alone for so many years, largely without any kind of safety net. In “Temptress Returns,” he recalled riding out the hurricane near the Azores when “one overtaking wave towered above me,” showing the silhouettes of three sharks, “waiting for the kill.”

“These beasts swimming with such nonchalance and ease in their element beneath the crests, as safe in that weather as in a flat calm, made me think, ‘I don’t belong here. Man was never meant to go to sea in this weather. It is only his ingenuity which allows him to achieve the seemingly impossible and survive.’ Or was it really some atavistic urge?”

“Having largely divorced himself from nature,” he continued, “it becomes a battle between him and her.”