BOSTON (AP) — The NBA has agreed to a multiyear deal making DraftKings an official sports betting operator.

The Boston-based company joins a half-dozen others, including MGM and longtime daily fantasy sports rival FanDuel, with deals that allow them the rights to official betting data and NBA logos.

READ MORE: Rachael Rollins Nominated To Be U.S. Attorney For Massachusetts

Professional sports leagues have long banned any connection to gambling. But in the past few years they have embraced it and sought to profit from both daily fantasy sports and outright gambling on games. Last year, the U.S. Supreme Court tossed out a law that in effect prohibited sports gambling in most states.

READ MORE: Pilot Program For Free MBTA Rides On Route 28 To Begin August 29

The league says it will work with DraftKings to protect the integrity of NBA games.

MORE NEWS: Massachusetts Gas Prices Remain Above $3 Per Gallon; 'Could Be Less Expensive In August'

(© Copyright 2019 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)