Time Warner Inc.'s HBO agreed to license older episodes of its programming library to Amazon.com Inc.'s Prime membership streaming service, the first time the premium cable channel has struck such a deal with an online video provider.

The deal means that most past HBO shows such as "The Sopranos," and "The Wire" will be available online for streaming without a separate fee. Until now, HBO has made its library of shows available for digital purchase, such as through Amazon and Apple Inc.'s iTunes service,...