(ABC News) -- When a student gave birth to her first child during the second week of class, her professor encouraged the student to bring her newborn to class to make it easier on her.

Sarah Thompson is an applied mathematics major at Lander University in Greenwood, South Carolina, and one of only two women enrolled in Dr. Josie Ryan's math class.

"The first day I went to class, I was actually a day past my due date," Thompson recalled. "I was 10 months pregnant."

When she returned the following week "small again," Ryan "begged" that she bring her newborn baby to class with her to make the transition easier, Thompson told ABC News.

Thompson, 26, and her boyfriend, Christopher Maggiacomo, welcomed William Isaiah to the world in August.

Although initially she dismissed Ryan's suggestion, one morning when it was difficult to prepare everything for her mother to watch baby Isaiah, as he's known, she decided to just take him to class.

"He was sweet. He just slept the whole class," Thompson said.

That's when Ryan picked up baby Isaiah, who was sound asleep "and taught the entire class like that," the new mother added.

Thompson shared the now viral photo on Facebook of Ryan holding baby Isaiah while teaching.

Since then, Thompson said she has brought her baby to class with her about five times.

"Every time I bring him to class, everybody is like, 'Aww!'" Thompson said. "Everyone looks at him and talks to him and then we get back to the class. This is a very, very hard math class. I'm very lucky that he's a quiet baby."

Thompson said that when she graduates, she hopes to work for her father's engineering company or make video games or computers.

With Ryan's help, Thompson said she knows she'll have the support she needs.

"She's so accepting and she even went out of her way [to say], 'Let me show you where the breastfeeding room is.' She wanted to make sure I was comfortable," Thompson said. "She's so brilliant and so smart."