Billionaire investor and philanthropist Robert F. Smith was giving the commencement speech at Morehouse College in Atlanta on Sunday, when he deviated from his prepared remarks to make an announcement: ‘‘My family is going to create a grant to eliminate your student loans!’’

Morehouse College where the late civil rights leader Dr Martin Luther King Jnr. was educated  honoured Strive Masiyiwa with an honorary doctorate

‘‘Everyone started crying and jumping for joy,’’ said a spokesperson for Smith, who asked not to be identified. ‘‘It was him speaking from his heart.’’

It’s hard to estimate the cost of Smith’s gift to the 2019 graduates of the all-male historically black college, but it could be in the range of $5 million to $10 million, according to estimates. There are 400 graduates in the class, and Morehouse costs about $26,000 per year, his spokesperson said.

a group of people that are talking to each other: Morehouse College graduates reacted on Sunday when commencement speaker Robert F. Smith said he would pay off the Class of 2019’s student loans. © Atlanta Journal-Constitution Morehouse College graduates reacted on Sunday when commencement speaker Robert F. Smith said he would pay off the Class of 2019’s student loans. There was celebration at Morehouse as the grads and their parents processed the news.

Tonga Releford, whose son Charles Releford III is a member of the Class of 2019, told the Atlanta Journal-Constitution that her son’s student loans are an estimated $70,000.

‘‘I feel like it’s Mother’s Day all over again,’’ she told the paper.

Graduate Elijah Dormeus, a business administration major, told the newspaper: ‘‘If I could do a backflip I would. I am deeply ecstatic.’’

Dormeus, 22, who is from Harlem, said he has $90,000 in student loans. His mother, Andrea Dormeus, who drives a school bus, came to his graduation with his five siblings.

In addition to being commencement speaker, Smith received an honorary doctorate from the school Sunday. He didn’t announce the motivation behind his gift, but there might be some clues in his remarks to the graduates. At the beginning of his speech, he said that earning a college degree is one of the ‘‘greatest and most impressive’’ accomplishments in a person’s life.

‘ Robert F Smith gives the commencement address during the Morehouse College 135th Commencement at Morehouse College on May 19, 2019 in Atlanta, Georgia. © Getty Robert F Smith gives the commencement address during the Morehouse College 135th Commencement at Morehouse College on May 19, 2019 in Atlanta, Georgia. ‘But success has many parents,’’ he continued. ‘‘And as hard as each of you has worked to achieve what you all have achieved today, you’ve had a lot of help along the way. We are the products of a community, a village, a team.’’

Smith talked briefly about his family, saying that one of his daughters is graduating from New York University this week, another is finishing high school and will attend Barnard in the fall, and his niece is graduating from his alma mater, Cornell, next week. He said that before he got into private equity and made his fortune, he was a chemical engineer who ‘‘spent pretty much every waking hour in windowless labs doing the work that helped me become an expert in my field.’’ That, he said, was the foundation for his success.

‘‘Only after I put in the time to develop this expertise and the discipline of the scientific process [was] I was able to apply my knowledge beyond the lab,’’ he said. ‘‘Greatness is born out of the grind. Embrace the grind.’’

Robert F Smith gives the commencement address during the Morehouse College 135th Commencement at Morehouse College on May 19, 2019 in Atlanta, Georgia. © Getty Robert F Smith gives the commencement address during the Morehouse College 135th Commencement at Morehouse College on May 19, 2019 in Atlanta, Georgia. He encouraged the graduates to enjoy their diplomas, but also impressed upon them the responsibility to do great things with it.

‘‘The degree you earn today is one of the most elite credentials that America has to offer,’’ he said. ‘‘But I don’t want you to think of it as a document that hangs on a wall and reflects what you’ve accomplished up till now. No. That degree is a contract — a social contract — that calls on you to devote your talents and energies to honoring those legends on whose shoulders you and I stand.’’

Smith, who is chairman and CEO of Vista Equity Partners, a software and technology investment firm, declined to be interviewed for this article, but with this gift, he has raised his profile, and has a lot of people talking.

‘‘It literally takes your breath away,’’ his spokesperson said.

His announcement comes after he had already pledged $1.5 million to the school in part for student scholarships and new park on campus.