With Britain closing in, Nathan Adrian sprinted furiously to the wall. He just couldn't get there fast enough.

The American anchor got edged by Britain's Duncan Scott in the 4x100-meter medley relay on the final night of the world swimming championships Sunday.

Still, the silver medal was a victory for Adrian, competing seven months after being diagnosed with testicular cancer.

The United States men's 4x100m medley relay team, from left, Ryan Murphy, Andrew Wilson, Caeleb Dressel and Nathan Adrian pose with their silver medals at the World Swimming Championships in Gwangju, South Korea, Sunday, July 28, 2019.

The United States men's 4x100m medley relay team, from left, Ryan Murphy, Andrew Wilson, Caeleb Dressel and Nathan Adrian pose with their silver medals at the World Swimming Championships in Gwangju, South Korea, Sunday, July 28, 2019.

"I don't want to come off like a sore loser," he said, "but I'm truthfully very grateful just to be here."

The 30-year-old Californian went public with his diagnosis in an effort to spread awareness. He underwent two surgeries and then began the process of regaining weight and muscle.

Adrian said he's been in touch online with others who endured the same things he did at the same time "and they're doing chemo right now," he said.

He underwent a scan a week before joining the U.S. team, and if the results hadn't been good, he wouldn't have made the trip.

"Literally, they could have been like, 'Hey, we found a node on your lung, you need to be in chemo next Tuesday,'" he said. "I get a little emotional even thinking about it."

Earlier, Adrian anchored the U.S. to gold in the 4x100 freestyle relay with the Russia breathing down his neck on the last lap.

Sunday night, it was Britain's turn to apply the pressure.

Caeleb Dressel hauled the Americans from fourth to first on his butterfly leg before turning it over to Adrian.

"That last 15 meters, it's tough," Adrian said. "I was trying to be strong, I was trying to hold on, but this time I couldn't do it."

Adrian was chosen as one of the U.S. swimmers to accept the FINA trophy awarded to the best team at the worlds. He and three of his teammates stood on the top step of the podium, a view he'd like to have next year at the Tokyo Olympics.

"There's a time to get silver in relays and it's at a world championships, that's for sure," he said.

Associated Press freelancer Jolene Latimer contributed to this report.

More AP swimming coverage: https://apnews.com/tag/Swimming