It was a history-making day for Oussama Mellouli, who became the first swimmer to win a medal in both the pool and open water in a single Olympic Games.

And it was a glorious day for the nascent Olympic sport of marathon swimming, as a crowd of 20,000 lined Hyde Park’s Serpentine Lake on a sun-drenched afternoon to witness Mellouli’s gold-medal triumph in the men’s marathon 10-kilometer swim just six days after the Tunisian won bronze in the 1,500-meter freestyle.

But it wasn’t the day Alex Meyer had hoped for. After surging to third in the early going of Friday’s race, the former captain of Harvard’s swim team finished 10th, climbing from the murky water 53.1 seconds behind Mellouli’s victorious time of 1 hour 49 minutes 55.1 seconds.

Germany’s Thomas Lurz, 32, a five-time world champion, took silver (1:49:58.5), improving on the bronze he won in the Olympic debut of marathon swimming at the 2008 Beijing Games. And Canada’s Richard Weinberger, 22, who admits he is still overcoming a fear of deep water, took bronze (1:50:00.3).

“I felt pretty good through about the first 5K but just kind of fell off the wagon little bit,” said Meyer, 24. “Didn’t really have the extra little bit of magic to bring it home for the last 5K.”

Mellouli, 28, who swam competitively for Southern California and still trains with the Trojan Swim Club, climbed from the lake and pounded his chest, fully aware he had made history despite battling a virus and an aching shoulder and elbow.

And he didn’t try to sugarcoat the rigor of the marathon’s 10K distance (roughly 6.2 miles), more than six times that of the pool’s 1,500m, in which he won gold at Beijing.

“This [10K] race just hurts,” Mellouli said. “You’re in pain. Once you hit a wall, you just keep pushing. When you hit a wall, you keep pushing.”

It’s not only the distance that inflicts pain. The 10K is swimming’s only contact sport, particularly at the start, with 100 limbs thrashing in a furious tussle for position.

While the eventual medal winners managed to jump out ahead on the first of the event’s six laps to race single file, most everyone else stayed bunched in two dense packs, jostling, shoving and kicking one another for nearly two hours.

Meyer got himself clear of the melee early, crossing the timing gate in fourth after the first lap. And he was third after the second lap. But he drifted back into the thicket and found himself ninth, then 12th, then 14th as the subsequent laps ticked off.

“He just got caught up in the pack a little bit,” said Tim Murphy, the Harvard coach who has worked with Meyer the past six years and is serving as the U.S. Olympic swim team’s marathon coach in London.

“It got real crowded. He got banged around; got pounded a couple times. Every little bit takes a little starch out of you. And when it came time for everybody to move, he just had difficulty with it.”

In a sense, the 5-foot-11, 155-pound Meyer was competing for two Friday.

He had shared the dream of qualifying for the London Olympics with his friend Fran Crippen, a former Virginia swimmer who had mentored him in the art of open-water swimming.

Crippen died in October 2010, at age 26, during an open-water race held in the United Arab Emirates in water that later was determined too hot for distance swimming. According to the autopsy, heat exhaustion was partly to blame.

Meyer responded by calling on FINA, the sport’s international governing body, to enact and enforce more stringent safety standards for the sport. And he vowed to honor Crippen by qualifying for London.

Thursday night, Meyer spoke by telephone to Crippen’s parents. They wished him luck. And they told him to be safe.

“There were some tears,” Meyer said, declining to elaborate further. “But it was good to talk to them.”

And each lap that Meyer swam past the section of the lake where his relatives, friends and former Crimson teammates stood and cheered on Friday, his thoughts turned to Crippen.

“Every time I swam by there, I had a little surge of energy,” Meyer said. “So I was thinking about that stuff a little bit, but focused on the race for the majority of the time.”

Long-distance open-water swims are a grueling test of strength, stamina and mental resolve. But the setting for Friday’s race could hardly have been more sublime.

The rectangular Serpentine Lake, which King George II had created at the request of Queen Caroline in the 1730s, is situated in the heart of London’s verdant Hyde Park, with Kensington Gardens on its west bank and Kensington Palace just beyond.

Each of the 25 competitors was introduced, then lined up shoulder-to-shoulder on the pontoon that marked the start. At the sound of a horn, they dove into the murk and took off for the first buoy. It was mayhem from every vantage point, an eruption of elbows and feet and colored swim caps bobbing up and down amid the wild splashing.

Meyer’s strategy was to keep the leaders within range, yet take advantage of the slipstream created in their wake so he could conserve his energy for a final charge.

But after dropping to 14th, stuck in the middle of the pack, he was fighting himself as well as everyone ahead of him,.

“I was battling some pretty negative thoughts on the last lap,” Meyer said. “I was trying to keep those subdued, but I just didn’t have it at the end.”

Meantime, Mellouli only got stronger at the front, with no one in his way and Lurz and Weinberger several lengths behind.

“What happened today was a miracle,” a triumphant Mellouli said, “if you believe in miracles.”