Michael Phelps points to the stands after winning the 200m IM. (Jonathan Newton/The Washington Post)

Michael Phelps’s résumé changed over the past week only in the particulars. He could have served as a television commentator here, offering insights on the swimming races with a beer and a burger waiting afterward, and he still would have been able to put at the top: Greatest Olympian in History. Instead, Phelps chose a swimming suit, the pool and the pain that comes with them.

He replaced a lackadaisical effort with an honest one. He replaced a forced smile with a broad, toothy grin. And Saturday night, the greatest Olympian in history was set to close that career precisely as he envisioned. If his career is incomparable, his final act felt that way, too.

“I’ve been able to kind of finish how I wanted to,” Phelps said. “I’ve been able to come back. I’ve been able to accomplish things that I just dreamt of.”

Each of the more than 11,000 athletes at these Games arrived because of some sort of dream. Phelps, though, stretched the parameters of where those dreams might reach. Over the course of the past four Olympics, the simple arithmetic of his medal haul — now up to 23 gold medals , 28 overall , both obliterating old records — makes his task appear easy. A summer pastime, every four years: Flip on the television. Watch Phelps win a medal. Turn in for the night.

“People have no idea how difficult it is to win one Olympic gold medal,” said Bob Bowman, Phelps’s lifelong coach. “Michael has done it so frequently that it’s really hard to put into perspective. But every one of those was hard.”

The last attempt came Saturday night in the 4x100-meter medley relay, in which Phelps swam the butterfly leg, taking a deficit and turning it into an advantage. So the particulars — after another race, another medal stand — changed again because the Americans won. It was Phelps’s fifth gold medal of these Games.

But his place in the history of swimming — or rather, in the history of all sports — wasn’t going to be altered by one race. Before the Games, Nathan Adrian, a freestyler who anchored the medley relay team Saturday, was tasked with presenting Phelps to the entirety of Team USA as a candidate to bear the American flag at Opening Ceremonies.

“I remember saying, ‘Michael Phelps has set a precedent in that every time we walk on the pool deck, it’s expected for gold,’ ” Adrian said. “That’s what he has done to the Olympic movement.”

That was before Phelps so much as dipped a toe in the water here. What to make of the past week, then? Before the final relay, in what he swears will be the last race of his Olympic career, he won gold in two individual events, gold in two more relays, silver in the last individual event of his career, Friday’s 100-meter butterfly.

Phelps didn’t need such accomplishments for his legacy. He needed them for himself.

“I didn’t want to have a ‘what-if’ 20 years later,” Phelps said. “I think being able to close the door in this sport how I want to, that’s why I’m happy now.”

After Michael Phelps retired from swimming following the Olympic games in 2012, he was arrested for a second DUI in 2014 and entered a rehab facility in Arizona. Now, he is focused on making history at his fifth Olympic games in Rio. (Jayne Orenstein/The Washington Post)
Going all-in

Phelps used that word — happy —all week here, and it’s one indication of the differences from London four years ago, when he first tried to step away from the sport. Though by anyone else’s standards he swam splendidly at those Olympics — four golds and two silvers — he knew what others didn’t: He had not prepared properly. In a sport in which faking it is almost invariably punished with poor performances, Phelps had faked it and — other than a fourth-place finish in the 400 IM — won anyway.

He understood that knowledge would eat at him not just through the next Olympics but for the rest of his life.

“Before, I was always looking for shortcuts,” Phelps said here. “I was kind of always looking, ‘Oh, well maybe I can skip a week here or skip a week there and still get by.’ ”

So when he committed to a comeback, he committed to an attitude overhaul. It has been on display here, with smiles after almost all of his races. But it was apparent, too, in all of his training with Bowman in Tempe, Ariz., where Bowman had taken the head coaching job at Arizona State. Chase Kalisz, the silver medalist here in the 400 IM, was once an admirer and later a training partner of Phelps back at the North Baltimore Aquatics Club. In preparation for Rio, Kalisz moved to Tempe to work with Phelps and Bowman again. Last September, immediately after Kalisz returned from the world championships in Kazan, Russia, Phelps called him.

“We talked, and it was so cool,” Kalisz said. “He was just like, ‘It’s going to be different. We’re going to put it all in.’ ”

The next day, a Sunday, Phelps and Kalisz went to an empty pool and worked out. No other swimmers participated. This became the new normal. Before London, Bowman occasionally went weeks without knowing whether Phelps, sometimes consumed by misery, would return to the pool. Before Rio, Phelps rode with Allison Schmitt, another longtime training partner, back and forth to the pool, playing games of “Slug Bug,” in which they whacked each other whenever one saw a Volkswagen Beetle. They belted out country songs, Eric Church and Dierks Bentley. They had, of all things, fun.

“The joy I see in him in this past year has been incredible,” Schmitt said. “Yes, we still have days when we have our ups and downs, but he went into every practice with a good attitude. He made it enjoyable.”

Focus and commitment and joy don’t immediately translate to results, however, even for the greatest ever. And as much as Phelps is at the center of the sporting universe now, this comeback was staged largely in overlooked meets noticed only in the tightly knit but somewhat isolated swimming community — and the initial results demoralized him.

In Charlotte last year, for instance, he swam so slowly in the 200-meter individual medley, in which he had three Olympic golds, he was relegated to the B final — a race for those who finish out of the top eight during preliminary heats. His time, 2:00.25, was more than six seconds slower than the best of his career.

“There were multiple times . . . where I said, ‘What the hell am I doing back swimming again?’ ” Phelps said. “ ‘I’m swimming so slow. This is terrible. What’s going on?’ Just frustrated.”

‘He did it the right way’

Though he had cut corners over the years, he knew what the correct process was, and he trusted it. Even as he reached his 30s, his times came down again. By midway through the U.S. trials, during which he turned 31, it became apparent that the training had worked.

“I guess I kind of went through some obstacles that I probably maybe didn’t want to go through before,” Phelps said. “But I was open to it now because I wanted to be able to be back to where I am now.”

During the entirety of Phelps’s comeback, Bowman had spoken of paring down his program. And yet Saturday night, Phelps swam for his sixth medal of this meet — one fewer than he won as a 19-year-old in Athens, the same as he won as a 27-year-old in London.

The physical toll, which Phelps simply snarled at in Athens and Beijing, was real here. A 19-year-old can’t know what a 31-year-old’s body feels like, but a 31-year-old remembers what it was like to be 19. Occasionally at Olympic Aquatics Center, he pulled himself gingerly from the pool, caring for each muscle as if it were a baby kitten. At one point, he asked Ryan Lochte — a contemporary, teammate and opponent for a dozen years — how they pulled off such aggressive programs in 2008.

“My body is in pain,” Phelps said. “My legs are hurting. I’m tired.”

Those words, on paper, sound like a lament. Phelps appeared to relish them.

“I can definitely see he’s enjoying every moment of this,” said Schmitt, who watched the final of the 200-meter butterfly from her room in the Athletes’ Village.

“You could just tell how much he was gleaming, how much pride he had in himself and the journey that he’s been on,” Schmitt said. “I said to him, ‘Wow. That was a very genuine smile. I don’t think I’ve ever seen you that happy.’ ”

She took that back. She had seen it once before: a picture showing Phelps holding his son, Boomer, just after he was born in May. In Rio, Phelps took time to cradle Boomer, to embrace fiancée Nicole Johnson, after his win in the 200 fly. His circumstances were so different in London. But so was his outlook.

“In London, I think he was so excited to be done,” said Peter Carlisle, Phelps’s longtime agent at Octagon. He would call Carlisle during the meet, asking whether he could plan a trip for afterward, inquiring about where he might go. “There hasn’t been any of that here. None. He’s 100 percent in the moment.”

Which has made each moment more rewarding.

“This has been a very, very special week so far for me,” Phelps said, “closing out my career.”

But why close it? Phelps said in London that he would give up swimming — and came back. So, given the way he embraced this ride and the hardware it yielded, it’s easy to speculate that he will do it again four years from now in Tokyo. His answer Friday night, for the zillionth time: A plain “No.” That might mean more than four years ago.

“The difference is he’s been retired now,” Carlisle said. “He’s grown so much as a person. Like any of us, when you’re 17 and 21 and 25, your perspective changes. You have a more solid foundation, more perspective — more wisdom, really. To say he’s done now is different. The conviction is the same, but I think the depth of the feeling and experience have changed.

“At the same time, it’s too early to tell. I think it’s against the odds, and I certainly believe him. But circumstances change.”

Just as they did entering Rio and just as they have this week. The medal count is staggering, maybe unmatchable — but it was that way four years ago. Put aside the new medals, though. This exit wasn’t necessarily about them anyway. Look instead at Phelps’s face, at the way he carries himself. Watch him, after the medley relay, bent at the waist in utter exhaustion, then stand upright and wave for the cheers, acknowledging his departure. Update the résumé, sure. But understand it’s the résumé of a vastly different character.

“I’m ready to retire,” Phelps said. “And I’m happy about it.”