David Wise, right, embraces Alex Ferreira, who he bumped out of gold medal position. (Martin Bureau/AFP/Getty Images)

The experiences here of America’s two freestyle ski medalists had almost nothing in common Thursday. One skier, Alex Ferreira, was dominant all day, pulling off the best run in the first heat, the best run of the second — and a run in the third heat that scored even higher than those two. The other skier, David Wise, struggled all day, changed skis three times, spent much of the competition near last place, and only vaulted to the top — above Ferreira, above everybody else — on the last run, one that he called the best of his life.

But those experiences dovetailed at the podium, where America’s loaded team of freestyle skiers grabbed the top two places in the men’s ski halfpipe event, a performance that continues the United States’ medal surge as these Winter Olympics near a close.

Wise, 27, and Ferreira, 23, provided their country its 18th and 19th medals of the Games — seven of which have come in the last 36 hours. In this case, the medals were earned by a pair who have lived as roommates in Korea for more than three weeks and who started their time here by getting matching left arm tattoos of the PyeongChang logo.

“I love him to death,” Ferreira said of Wise.

In taking first place, Wise defended the gold medal he’d won in Sochi. But he came to this one differently, overcoming an uneven day in which his first two error-filled runs scored a 17.00 and a 6.40. Before taking off on his last run, Wise asked his coaches if he should try to pull off a technically difficult set of moves, four different kinds of double corks. Wise was thinking he shouldn’t.

“They said, ‘That’s not who you are,’ ” Wise later said. “So I went for it.”

He nailed it. He earned a 97.20 and a roaring ovation.

“I’m just over the moon,” he said.

The United States had eyed this event as one of its most promising. The finals included 12 skiers — four of them Americans, all of whom had survived an earlier round of qualifying that pared the field from 27. During that qualifying round, U.S. skiers Aaron Blunck, Ferreira and Torin Yater-Wallace had posted the top three scores of the day. Wise had finished eighth, but he was still considered a medal favorite. The team was loaded with so much talent that Wise said just making the team was a “lifetime accomplishment.”

Entering the Olympics, Wise was coming off what he called the “worst two seasons” of his career. Before coming to South Korea, he wrote on his blog about all he had been through since Sochi. He’d dealt with three concussions. His sister had lost her leg in a boating accident. His wife, after giving birth to a second child, went through what Wise described as a “hard year of postpartum depression.” During one of his ski trips, he also learned that his youngest child had experienced a febrile seizure. His skiing suffered. Some of his sponsors parted ways with him.

The blog post ticked off some slights, but ended on a note both hopeful and fired up.

“The problem is the haters forgot who I am,” he wrote. “I have to admit I am to blame too. I am not naturally a transparent person. I don’t tell people when I am struggling, and I don’t often share the burden. During the tough times these past years I didn’t reach out and let people know how hard of a time I was having outside of skiing. I just kept my head down and kept fighting. That is what the naysayers and critics fail to realize. I am a fighter, and fighters do their best work in adverse conditions.”

Wise’s closest competitor on Thursday was Ferreira, competing in his first Olympics, who finished his runs with an exultant celebration in which he twirled his right ski pole in the air. Ferreira later said the skiers were “feeding off one another,” and what that led to was a feast-or-famine event in which skiers aimed high — succeeding or failing spectacularly. At least two skiers, including Yater-Wallace, took nasty spills on the lip of the halfpipe and went tumbling down. The bronze medalist in Sochi, France’s Kevin Rolland, never posted a score higher than 6.40. Meanwhile, four riders hit scores above 90.

Blunck finished seventh and Yater-Wallace, who walked off after his brutal crash, finished ninth.

“The competition was so epic,” Wise said.