Seeking a greater return on the rise in the sale of its merchandise and the company that handles the majority of licensed sports business, the NFL has invested $95 million in Fanatics, the sports retailer that also runs its official online shop.

The deal, first reported by Sports Business Journal, and confirmed by ESPN, is for a 3 percent total stake in the business. It values Fanatics, which entrepreneur Michael Rubin bought for $277 million in 2011, at $3.17 billion.

The strategy for the NFL, whose executives are not yet publicly commenting on the deal, is to get a piece of the upside from the company's growing business instead of just getting the standard licensing fee. A representative for Fanatics also declined comment.

In an effort to net a greater return from sales of its merchandise, the NFL has purchased a small stake in Fanatics, the sports retailer that also runs its official online shop, for $95 million. Kirby Lee/USA TODAY Sports

As e-commerce has continued to rise in terms of the percentage of purchases versus those made at brick-and-mortar stores, Fanatics has continued to grow and change how business has been done.

Last year, the NFLPA made Fanatics its master licensee, meaning that any company that wanted to produce player-branded items would have to go through Fanatics for approval. Starting this year, companies making NFL player-branded items are paying a sub-licensing fee to Fanatics.

Being the largest distributor of licensed products in sports had its benefits, but the company really started to take off when it started making its own products.

Before selling his main business, GSI Commerce, to eBay in 2011, Rubin secured the online shop rights to all the major sports leagues, winning the business by promising to physically warehouse the merchandise to ensure faster delivery compared to competitors who only offered a virtual service.

That meant that an inventory risk had to be taken; if a player got traded or became significantly less relevant, the company would have a glut of product it couldn't move and would have to write it off as a loss.

In recent years, Fanatics has solved that problem by investing more than $100 million in technology and production that allows it to create the ultimate vertical platform -- conceiving ideas, getting them quickly approved and posting to the main site, as well as the league and team sites it manages, where the product can be sold minutes later.

Soon, the company will producing on-field jerseys itself. Fanatics, with Under Armour, will have a contract to produce on-field uniforms for Major League Baseball in 2020. But that might happen sooner, as Fanatics recently closed its purchase of Majestic Athletic, which is the league's current on-field uniform licensee with Nike.

In recent years, the company also expanded the size of its warehouse in Jacksonville, Florida, built another one in Ohio and is currently building a western center of operations in Las Vegas.

Major League Baseball also recently purchased a stake in Fanatics, a $50 million piece, according to Sports Business Journal, which is said to be for 1.5 percent of the company.