Uncovering and explaining how our digital world is changing — and changing us.

A media company has become a sports betting company: The owner of Barstool Sports has agreed to sell the popular and controversial digital sports publisher to Penn National Gaming, a regional gambling operator.

The deal values Barstool, which has its roots as a rowdy Boston sports blog founded in 2003, at an eye-popping $450 million.

Earlier this month, I reported for Recode that the Chernin Group, which bought a majority stake in Barstool in 2016, was close to selling the company to Penn National.

The Wall Street Journal has been briefed on the details, which are scheduled to be formally released Wednesday morning: Penn National will first buy a 36 percent stake in Barstool for $163 million in cash and stock — valuing the company at $450 million. Three years later, the casino company will pay another $62 million to bring its stake to 50 percent, with the ability to buy controlling ownership for an amount to be determined at the time.

Here’s the official announcement, along with a very Barstool-like announcement, where Barstool founder Dave Portnoy tells his fans that they should buy Penn National’s stock, followed by a long legal disclaimer explaining that Portnoy doesn’t represent the views of Penn National and that his advice to buy Penn National stock shouldn’t be interpreted as financial advice:

Emergency Press Conference - All Aboard the Barstool Rocket Ship pic.twitter.com/NWK2n9PoIP — Dave Portnoy (@stoolpresidente) January 29, 2020

A person briefed on Barstool’s business estimates the company generated between $90 million and $100 million in revenue last year, with the majority coming from podcasts, merchandise sales, and gambling deals.

It’s a stunning deal for the digital media industry, coming as many publishers are retrenching after a round of ultimately disappointing Facebook-fueled optimism and investment. And it’s a big payoff for the Chernin Group, which had reportedly invested some $25 million to buy controlling stakes in Barstool in 2016 and 2018; people familiar with Barstool estimate that Chernin owned around 60 percent of the company prior to today’s deal.

That deal exists entirely because of a Supreme Court decision: In 2018, a court ruling legalized sports gambling in the US, but left it up to individual states to decide if they wanted to approve of sports betting, and under what terms.

Since then, there’s been a rush by both media companies and the gambling industry to capitalize on what they both assume will be a boom in online betting. Right now, the primary winners seem to be DraftKings and FanDuel — two companies that had spent huge sums of marketing money a few years ago, when they were operating as “daily fantasy” sports games.

The daily fantasy bubble deflated, but the investment those companies made exposing themselves to a young audience seems to have paid off. Industry executives say those two companies are out-performing older, more established gambling brands in states where online sports betting is legal.

Penn National, which runs or owns dozens of low-profile casinos and hotels around the US (its best-known property may be the Tropicana in Las Vegas), seems to think it can use Barstool’s brand to bring traffic to its casinos and an online betting app it wants to launch. And Barstool has found an owner that is unlikely to be worried about its brand and content, which is both popular and oftentimes intentionally abrasive.

Barstool founder Dave Portnoy will stay on at the company, along with CEO Erika Nardini and other employees.

Earlier this month, Barstool agreed to a settlement with the National Labor Relations Board, which looked into charges that Portnoy had broken labor laws by tweeting threats to fire employees that tried to organize a union. The agreement “calls for the deletion of the tweets and removal of other anti-union material created by the company,” Bloomberg reported.