TOKYO — When the emotions overtook him, high above the pool deck at Tokyo Aquatics Centre late Monday morning, Australian swimming coach Dean Boxall didn’t consider that he might become a viral sensation on social media. He wasn’t worried that his antics might in some way overshadow the accomplishment of his star swimmer, Ariarne Titmus, who had just taken down American legend Katie Ledecky in the final of the women’s 400-meter freestyle at the Tokyo Olympics.

Hey, it wasn’t Boxall’s fault. At that moment, that wasn’t really even him who was screaming, jumping, ripping off his mask, pumping his arms, thrusting his pelvis forward and ignoring the Japanese attendant who was trying to rein him in.

“I think I went outside my body,” Boxall explained to a small group of reporters between pool sessions. “I just lost it.”

It was a display that stood in stark contrast to the graceful reaction of Titmus, who after out-touching Ledecky by 0.67 seconds to earn her first career Olympic gold medal, accepted congratulations from Ledecky in the lane next to her and later thanked the six-time Olympic medalist for being an inspiration.

“She’s pretty grounded,” said Boxall, who coaches Titmus (whom he calls “Arnie”) at St. Peters Western swim club in Brisbane. “You can see — I think I was more emotional than her. She was basically saying, ‘You need to settle down.’ ”

It appeared to be a snapshot of the reputation that Boxall has cultivated as a promising young coach on the rise in Australia, a colorful and controversial personality who has been credited with unlocking Titmus’s potential. She told reporters after Monday’s race that her 43-year-old coach “means everything to me” and that he was crying as she was awarded the gold medal.

“It was actually hard to contain it. I could see Dean on the other side bawling his eyes out,” she said. “You don’t see that that often, so that made me want to tear up.”

Boxall explained his emotional reaction to Titmus’s victory as “a matter of being with this girl for five years and having a dream together.”

“I can’t help it. I believe with my athletes,” he said. “When they leave [the pool] they go start the recovery process and go home. And they switch off. I don’t. I go home and try to find a way for them to get better. I just don’t turn off. That’s probably why I let [the emotions] out. It’s probably why I felt emotional — because it’s not just a 9-to-5 job. It’s 24-7. I wake up at night and I’m thinking of, ‘How can Arnie get better?’ ”

When Boxall began working with Titmus, in 2016, her best time in the 400 free was a 4 minutes 11.78 seconds, while Ledecky that summer was setting a world record of 3:56.46 at the Rio de Janeiro Olympics — a margin of more than 15 seconds.

“Katie was so far in front of us that in the beginning when I started coaching her we couldn’t even have that conversation” about someday beating her, Boxall said. “It’s unbelievable. We just started chipping away and started to believe.”

Boxall acknowledged that a victory such as Monday’s might not have been possible without the one-year delay of the Tokyo Games by the coronavirus pandemic — which gave Titmus an extra year to develop, mature and gain strength and speed.

“I don’t know that we would have gotten it right for Tokyo last year,” he said. “This year has helped us. … She was confident after 2019, and she was ready to tackle it. But I think she [was still] maturing as a girl. Her life around her — she’s put things in order. She’s not this girl that came to me at 15. That’s why she’s just blossomed.”

Aside from helping develop Titmus, Boxall has an electrifying presence — he has long blond hair and, as the world saw Monday, can be animated in his coaching from the deck. He is also reportedly a controversial figure in the Australian swimming world and has been accused of running militaristic-style training programs within his club.

Boxall has addressed his unconventional coaching methods — he says he doesn’t believe in coaching through textbooks, so he teaches through instinct.

“People might look at it as a negative, but I’m not a well-read swimming coach. You have a plan, but that plan often goes AWOL. There is always something that goes wrong,” Boxall told the Sydney Morning Herald in 2019. “If I follow someone else’s philosophy and don’t have my core ideas … I lose my compass. I’ve never picked up a textbook about swimming technique. It’s more about feel and understanding and intuition.”

Ledecky would later tell reporters that Titmus had a “smart” game plan, and she said she lost despite feeling strong over the final 100 meters of the instant classic. Titmus caught Ledecky by the final turn and won with a time of 3:56.69, the second-fastest time ever in the event. After it was over and video of her coach celebrating went viral, Titmus told Sporting News Australia that she was sharing the landmark win with him.

“He becomes quite animated,” she said, “and I think this is just as much for him as it is for me.”

Boxall has been inundated with messages, of course, since his outburst went viral, but overwhelmingly, he said, those messages have been positive.

“I mean, some people — the Americans might not like it,” he said. “But they jump around as much as me.”