The "Sign of the Times" singer informed viewers that Corden and his wife Julia Carey welcomed their new baby girl half an hour before the show's taping and that he had already met the newest family member.
"She looks a lot like James," he said, "mainly because James looks like a giant baby."
In fact, Styles got the call to substitute for Corden only hours before.
"I sat at home two hours ago—in this suit obviously—and I got the call that Jules was going into labor," he said. "So James naturally called the funniest guy he knew, and he wasn't around. So, I'm filling in."
"I'd like to take an opportunity to announce that we will also be having a baby," Styles quipped.
Watch the video to see Styles step in as host.
Corden announced Styles would be substituting for him on Twitter along with the birth of this child.
"Today we welcomed a beautiful baby daughter into the world," Corden wrote. "Both she and her mother are doing great. We can't stop smiling. Thank you Harry for stepping in to host the show at 2 and a half hours notice! x x x"
Corden and his wife already have two children: a six-year-old son named Max and a three-year-old daughter named Carey.
Stay pop cultured with E! News weekdays at 12PM, 7PM & 11PM