The winning moment in the women’s U.S. Open final on Saturday occurred well after Naomi Osaka had beaten Serena Williams. It was during the trophy presentation, amid a firestorm of boos and jeers from a crowd angered by what had transpired earlier and precipitated the outcome.

The 20-year-old Osaka, having won her first Grand Slam title — and becoming the first Japanese athlete to do so — stared disconsolately at the ground. Williams, standing apart from her rival, was stone-faced.

As the crowd’s boos grew stronger, Williams did an astonishing thing. She leaned over to Osaka and put an arm around her. She squeezed the younger woman’s shoulder and murmured into her ear, and Osaka nodded. She visibly brightened. In a remarkable display of warmth between two competitors, we saw champion-worthy conduct, sisterly understanding and solidarity.

Before then, all was ugliness. That had nothing to do with the competition on the court. Or rather, it had nothing to do with how Williams and Osaka played tennis.

It had to do with an umpire making controversial calls, triggering Williams’s emotions and turning the match into a verbal brawl. As my colleague Sally Jenkins writes in a well-observed column, umpire Carlos Ramos “turned it into one of the nastiest and most emotional controversies in the history of tennis.” He penalized Williams for getting signals from her coach, for breaking her racket in frustration and then for calling him “a thief” in response to losing a point over the second violation.

There wasn’t a whole lot of inspiration to be found on the court, but that’s what makes the post-match presentation so striking. Williams mastered her feelings and directed everyone’s attention where it belonged: on the remarkable young woman who had just beaten her.

“Let’s make this the best moment we can,” Williams told the crowd from the podium when the microphone was passed to her. “We’ll get through it. Let’s give everyone the credit where credit is due, and let’s not boo anymore.”

She finished with a salute to Osaka and a deft handling of the crowd: “So congratulations, Naomi. No more booing! . . . Thank you, guys, the crowd, you really are the best in the world.”

In a statement later Saturday, U.S. Tennis Association Chairman and President Katrina Adams praised Williams as a “true champion” for the “great deal of class and sportsmanship” that she displayed.

Adams added, “The way she stepped up after the final and gave full credit to Naomi for a match well-played speaks volumes about who she is.”

Williams wasn’t the only one to demonstrate deference and class. When Osaka was asked to speak to the crowd, she began by apologizing and moved on to gratitude. “I’m sorry it had to end like this,” she said in a soft voice. “Thank you for watching the match.”

A few moments later, in response to a question about how the victory felt, Osaka turned to Williams and bowed her head. Then she said, “I’m really grateful I was able to play with you. Thank you.”

These two women showed us how to regain lost decorum by thinking of others, even when it seems as though the whole affair has been ruined. As a chronicler of human actions and interactions, I’m struck by the example that Williams and Osaka set of rising above an exceptionally difficult moment. It is so much easier to be considerate and restrained when the stakes aren’t high, when circumstances go as predicted or when the environment is controlled. It’s almost unfathomable to think about grace — let alone to muster it — when you face bitter disappointment not only in your own heart but also in those around you.

The women’s behavior toward each other is what we should remember from this tournament: Osaka’s quiet composure and humility, and Williams’s compassion and her choice to restore order and to honor the event, the fans, her rival and herself.