Warren Buffett is getting out of the newspaper business.

Berkshire Hathaway Inc. agreed to sell its BH Media unit and its 30 daily newspapers to Lee Enterprises Inc., which owns papers including the St. Louis Post-Dispatch, for $140 million in cash. Lee has been managing the papers for Buffett’s company since 2018, and Berkshire is loaning Lee the money for the purchase.

Buffett, who got a job delivering papers as a teenager and invested in the industry to capitalize on its one-time local advertising stronghold, lamented last year that most newspapers are “toast.” BH Media, which owns papers across the country, has been cutting jobs for years to cope with declining ad revenue.

“We had zero interest in selling the group to anyone else for one simple reason: We believe that Lee is best positioned to manage through the industry’s challenges,” Buffett said in a statement Wednesday.

In 2018, Buffett acknowledged that he was surprised that the decline in demand for newspapers hadn’t let up and that his company hadn’t found a successful strategy to combat falling advertising and circulation. That same year, U.S. newspaper circulation dropped to its lowest levels since 1940, according to the Pew Research Center.

The Lee sale will include Buffett’s hometown Omaha World-Herald and Buffalo News, a paper he’s owned for more than four decades, along with 49 weekly publications and a number of other print products, the companies said in the statement.

Berkshire is lending Lee $576 million at a 9% annual rate for the purchase and to refinance other debt. Excluded from the sale is BH Media’s real estate, which Lee is leasing under a 10-year agreement.

It’s a rare move for the conglomerate as Buffett has long said that he prefers to hold onto businesses. The newspaper deal, however, is Berkshire’s second divestiture in less than a year, including the sale of an insurance business in late 2019. Berkshire has held onto other old-fashioned businesses, including door-to-door vacuum-cleaner business Kirby Co. and encyclopedia publisher World Book.

Aside from a few bright spots, such as the largely thriving New York Times Co., the newspaper business is in crisis across the U.S. McClatchy Co. -- which owns about 30 newspapers, including the Miami Herald and Charlotte Observer -- is fighting to avoid bankruptcy as it contends with pension obligations and debt. The Salt Lake Tribune became a nonprofit last year, after failing to find a profitable business model.

As print advertising has cratered in recent years amid the rise of social media, Craigslist and search ads, private equity firms and hedge funds have swooped in to take advantage of newspapers’ steady though dwindling revenue streams.

New Media Investment Group Inc., controlled by private equity firm Fortress Investment Group LLC, bought USA Today owner Gannett Co. last year to form the largest U.S. newspaper chain. The deal spurred apprehension in journalism circles given New Media’s reputation for newsroom layoffs, though the new Gannett leadership pledged to avoid widespread job cuts.