Driverless trucks will one day hurt railroads and auto insurers, Warren Buffett said Saturday.

"Driverless trucks are a lot more of a threat than an opportunity to Burlington Northern," Buffett said at Berkshire Hathaway's annual shareholder meeting in Omaha, Nebraska.

Berkshire owns the Burlington Northern railroad company and auto insurer Geico.

"Autonomous vehicles widespread would hurt us ... if they spread to trucks, and they would hurt our auto insurance business," Buffett said.

Buffett expects autonomous vehicles will "certainly come," but thinks "they will be a long way off."

"If they make the world safer...it will be a very good thing but it won't be good for auto insurers," the chairman of Berkshire added.

— CNBC's John Melloy contributed to this report.