When Wayne Hayer couldn’t find a babysitter for his 5-month-old daughter Assata, he remembered a promise his Morehouse College professor had made him.

Mathematics professor Nathan Alexander, at the Atlanta-based historically black college, had told the college senior he could take his daughter to class if he needed, but Hayer hadn’t intended to take him up on it.

It just so happened that the kinesiology student was left with no other option on Friday.

ARKANSAS COUPLE ADOPTS SEVEN SIBLINGS AT ONCE, GIVING THEM A 'FOREVER FAMILY' AHEAD OF CHRISTMAS

Hayer's wife, who usually stays home with their baby, was going to pick up Assata’s birth certificate and Hayer didn’t want her to have the hassle of carrying a baby on public transportation by herself, according to The Washington Post.

Hayer told the outlet he felt nervous about bringing a baby to class, especially at an all-male college. He had heard of women taking their children to classes before.

But midterm exams were coming up and Hayer had to make it to the lecture either way.

When Hayer, laden with his book bag on his back and Assata strapped to his chest, walked into Alexander’s classroom, the professor didn’t even bat an eye.

He said: “No problem, in fact I will even hold her so you can take better notes in class,” Hayer’s classmate, Nick Vaughn, wrote in a Facebook post.

Alexander held Assata for the whole lecture. He even stayed after and answered students’ questions about the lecture, with the 5-month-old still strapped to his chest.

GROUP OF TEENS SAVE 8-YEAR-OLD BOY HANGING FROM SKI LIFT

Vaughn posted pictures of Alexander and Assata on Twitter and Facebook on Friday and the heartwarming posts went viral.

“It was this encounter that truly showed me the power and impact HBCU’s can have for the black community, for this professor to understand that life happens and sometimes there are just no ways around it,” Vaughn wrote on Facebook.

Alexander told The Washington Post that he is proud of Hayer and was happy to help him out.

“There’s an idea of what a student is and we don’t think about ways to support parents that are students. That’s where I come in,” he said.

“Community matters. I want a world where Wayne doesn’t feel like he can’t get ready for his exam even though his child care fell through.”