Saks Fifth Avenue and Neiman Marcus have reportedly agreed to a blockbuster merger that combines the nations two dominant luxury retailers — and Amazon is joining the deal, too.

Saks owner HBC, whose talks to merge with its longtime a were first reported by The Post last summer, will acquire Neiman Marcus for $2.65 billion, according to sources close to the situation — a once unthinkable tie-up that comes as both chains grappled with a multiyear slowdown in luxury spending.

In a surprise twist, Seattle-based Amazon the e-tailing giant headed by billionaire Jeff Bezos will become not only a minority investor in the new company — to be called Saks Global — but also will provide technology and logistics services to the merged operation, sources told The Post.

The deal will give Amazon unprecedented access to the luxury market — a tricky segment where the company has tried and mostly failed to get a credible foothold for more than a decade.

Business software giant Salesforce — headed by Silicon Valley tycoon Marc Benioff — also will become an investor in Saks Global, sources said.

Just two months prior to Saks acquisition, private equity firm Ares Management and the Canada Pension Plan Investment Board bought Neiman Marcus for $6 billion.

As for Amazon, the company already provides cloud services and call center technology to Saks, while Salesforce provides technology services.

The deal will be financed by a $1.15 billion term loan from Apollo Global Management and a $2 billion revolving asset based loan from several banks including Bank of America and Morgan Stanley along with investments from Amazon and Salesforce, sources close to the deal said.

HBC, headed by Richard Baker, also raised over $2 billion of equity, setting up the combined businesses with less overall debt and significant liquidity for further investments in inventory and for growth.

Saks Global will be helmed by Saks chief executive Marc Metrick.

Its not clear what, if any, role Neiman Marcus CEO Geoffroy van Raemdonck will have.

Sources have said that the Belgian-born executive stands to get a hefty payout should the merger go through — a sore point with some rank and file who have accused van Raemdonck of feathering his nest at their expense.

Van Raemdonck led Neiman through a 2020 bankruptcy during his six-year tenure, which was marked by nearly 100% turnover at the top levels of the company.

Dallas-based Neiman Marcus got new private equity owners, including Pacific Investment Management, Davidson Kempner Capital Management and Sixth Street Partners, after emerging from Chapter 11 in 2020.

In May, Neiman Marcus shed dozens of jobs within its headquarters and stores, according to LinkedIn posts about the cuts and employees who work for the company.

The deal is pending regulatory approval, which could take up to nine months, experts say, and carries risks, given the Federal Trade Commissions lawsuit in April to block Tapestrys $8.5 billion acquisition of Capri Holdings, which owns the Michael Kors brand.

Together Neiman and Saks operate some 175 stores including Neiman Marcus crown jewel Bergdorf Goodman in New York City. The companies own more than one third of the stores real estate, a source said.