Media playback is unsupported on your device Media caption The moment a billionaire cleared a whole class's student debt

A billionaire technology investor has shocked graduating students in Atlanta, Georgia, by telling them he will pay off all of their student loans.

Robert F Smith, one of America's most prominent black philanthropists, was giving an address at Morehouse College, a historically all-male black college.

Nearly 400 students will benefit at a cost of tens of millions of dollars.

The class of 2019 and their teachers were stunned at the news before breaking into applause.

Mr Smith, 56, founded private equity firm Vista Equity Partners in 2000 to invest in software companies, and has a personal net worth of $5bn, according to Forbes.

"On behalf of the eight generations of my family that have been in this country, we're gonna put a little fuel in your bus," Mr Smith told the graduates on Sunday.

"This is my class, 2019. And my family is making a grant to eliminate their student loans."

The billionaire was at the college to receive an honorary doctorate and had already announced a donation of $1.5m to Morehouse.

The exact cost of Mr Smith's latest act of generosity is unclear, as the college has yet to calculate the total debt of the students who will benefit, but it is estimated to be at least $10m (£7.7m) and could be significantly higher.

How did they react?

Aaron Mitchom, 22, wept at the news that he would not have to pay back $200,000 in loans he had taken out to fund his finance studies, AP news agency reports.

"I was shocked," he said. "My heart dropped. We all cried. In the moment it was like a burden had been taken off."

Morehouse College president David A Thomas was quoted by CNN as saying: "When you have to service debt, the choices about what you can go do in the world are constrained.

"[The grant] gives them the liberty to follow their dreams, their passions."