"As part of Nike's focus on elevating consumer experiences through more direct, personal relationships, we have made the decision to complete our current pilot with Amazon Retail," a Nike spokeswoman told CNBC in an emailed statement. "We will continue to invest in strong, distinctive partnerships for Nike with other retailers and platforms to seamlessly serve our consumers globally."

Prior to 2017, Nike had resisted such a deal with Amazon, focusing its attention on its own online marketplace and stores. The fear for many brands has always been that, by partnering with Amazon, a company loses control over how its brand is represented on the site.

The abrupt halt will end a pilot test that Nike and Amazon launched together in 2017. At the time, Nike agreed to sell a limited product assortment to Amazon, in exchange for stricter policing of counterfeits and restrictions on unsanctioned sales of its products. That included Nike's athletic footwear, apparel and accessories.

Nike will stop selling merchandise directly to Amazon , as part of its push to sell more directly to consumers, the company confirmed to CNBC.

The spokeswoman added Nike will continue to use Amazon Web Services to run its website and handful of mobile apps, like SNKRS.

Bloomberg first reported the change Tuesday evening. Amazon didn't immediately respond to CNBC's request for comment.

Nike brings in roughly 30% of annual sales from its direct-to-consumer business. In the fiscal year ended May 31, 2019, Nike's direct-to-consumer sales tallied $11.8 billion, fueled by a 35% jump in online sales and same-store sales growth of 6%.

Wholesale customer sales grew 10% during the same period. All told, Nike had $39.1 billion in fiscal 2019 revenue. Some of its biggest wholesale partners include Foot Locker, Dick's Sporting Goods and Nordstrom. And while it still invests in those relationships, it's been investing more in building out Nike stores and upgrading its apps and website.

The decision follows the recently announced hiring of John Donahoe, a Nike board member, as the sportswear retailer's next CEO. Donahoe was formerly the CEO of eBay and is a chairman of the board at PayPal, a sign that Nike is focusing on e-commerce.

Current CEO Mark Parker announced in late October that he will step down from his post in 2020.

Parker said in an interview with CNBC's Wilfred Frost that Donahoe should "enable this next level of growth," digitally, for the company.

Amazon, meantime, has been trying to become a bigger name in fashion for years now. It has launched more of its own clothing brands, partnered with influencers to tout items and has tried to court other big-name brands to sell on its site. Some of those include PVH's Calvin Klein, J. Crew and Chico's.

Evercore ISI analyst Omar Saad said the move by Nike makes him wonder "if many other brands follow."

Other analysts chimed in on Wednesday, saying Amazon isn't much of a fashion destination.

"Brands don't need Amazon," Jefferies analyst Randy Konik said. "Amazon had a delivery speed advantage, but that advantage has compressed. With Nike leaving then Amazon platform ... it strengthens our view that retailers/brands won't be displaced by Amazon."

Nike shares were up 1% in trading on Wednesday morning. Amazon shares were also down less than 1%.