Walt Disney Co. agreed to acquire a one-third stake in the video-streaming unit of MLB Advanced Media, in a deal valued at about $3.5 billion, according to a person familiar with the matter.

Disney, the owner of ESPN and ABC, will retain a four-year option to buy an additional 33 percent stake in the digital arm of Major League Baseball, said the person, who asked not to be identified because the information isn't public. WME-IMG, the parent of William Morris Endeavor and the owner of media properties including the Miami Open tennis tournament, was among the bidders for a stake in the business, the person said.

The deal underscores the importance of the video-streaming business to the future of ESPN, which has been losing viewers and advertising dollars to online media. ESPN has toyed with the idea of selling Web-only packages outside of the traditional cable-TV package, and Disney CEO Robert Iger is making deals to offer ESPN on internet services such as Sling TV.