Michael Phelps had to rise Wednesday morning and dive back into the pool at the Aquatics Center for preliminary heats of the 200-meter individual medley, just hours after he finally went to bed following the gold-medal performance he and his teammates delivered in the 4×200-meter freestyle relay. But he did so knowing he had support from around the world — at least on Twitter — after his record 19th Olympic medal.

Michael Phelps smiles and flashes the 15th gold medal of his Olympic career. (Matt Slocum/Associated Press)

“I think it’s the number of people,” Phelps said after he qualified fourth for the 200 IM. “I woke up and started scrolling through thousands of mentions and it was like, man this is a lot of things to look at.”

The one that stood out: A congratulatory tweet from President Obama. Phelps responded: “Thank you Mr. President!! It’s an honor representing the #USA!! The best country in the world!!”

But he also received congratulations from fellow Olympians — speed skater Apolo Anton Ohno, snowboarder Shaun White, other swimmers — and figures from all walks of life.

“Obviously I wanted to say thank you to all of my friends who sent some tweets to me, but Obama, and [Gerard] Pique, the soccer player,” Phelps said. “There were a bunch of different athletes and figures from all over the world that were sending me stuff. It was pretty cool.”

Phelps’s fourth-place swim merely moves him to Wednesday night’s semifinals in the 200 IM. His time of 1 minute, 58.24 seconds was more than a second slower than leader Laszlo Cseh of Hungary. American Ryan Lochte was second-fastest in 1:58.03. The finals for the 200 IM are Thursday.

The American women’s 4×200-meter relay team qualified second behind Australia for Wednesday night’s final. The lineup of Lauren Perdue, Shannon Vreeland, Alyssa Anderson and Dana Vollmer will definitely be shuffled tonight, with gold medalists Allison Schmitt and Missy Franklin almost certain to be added.