Struggling Barneys may have finally found its savior in the form of London-based online retailer Farfetch, The Post has learned.

Barneys, which has been scouting for buyers since before it filed for bankruptcy on Aug. 6, is in talks to sell itself to Farfetch in a deal that would also save the high-end clothing seller’s flagship Manhattan store, where it has been selling pricey duds for 26 years, sources told The Post.

Farfetch, which peddles luxury brands including Gucci, Karl Lagerfeld and Chanel, kicked off negotiations with Barneys before its Chapter 11 bankruptcy filing — but the talks have been heating up, sources said. In one sign of how serious things are getting, the e-tailer has even convinced the landlord of Barneys’ crown jewel location on Madison Avenue to slash the rent and take back 40% of the 10-story store, sources said.

Barney’s landlord, Ashkenazy Acquisition Corporation, has tentatively agreed to lower rent at the Midtown Manhattan store by 25% to a blended rate of $75 a square foot, according to sources. The deal would also call for Barneys to return the top five floors of the East 60 St. building.

No deal has been signed yet, but the agreement is significant because rent at the 660 Madison Ave. location, which doubled this year to $30 million, is what pushed Barneys into bankruptcy in the first place.

Barneys declined to comment on its discussions with Farfetch, but a spokeswoman insisted that there is no truth to rent and space reductions at Madison Avenue.

Reached early Tuesday, a Farfetch spokeswoman denied that the company plans to buy Barneys.

“The story is incorrect – Farfetch is not acquiring Barneys New York.”

Ashkenazy did not return calls for comment.

In the event of a deal, it’s not immediately clear what would happen to Freds, Barneys’ popular eatery on the ninth floor.

“That restaurant makes very little money anyway,” said a source with knowledge of the situation, adding that it would “cost a fortune” to move the restaurant to another floor. “Fred’s future is tenuous at best,” the source said.

Ashkenazy Acquisition would likely convert the upper floors to office space, the sources said.

The rest of the limestone building — or floors 10-22 — is owned by a separate investment group, which rents out the floors as office space.

Farfetch, which has been on a buying spree since it went public last year, sells luxury goods on behalf of nearly 1,000 sellers, including 375 luxury brands. It sells both pre-owned and new merchandise.

The company, founded by Portuguese businessman Jose Neves, acquired streetwear brand New Guards Group, which has the exclusive license for Off White, earlier this month for $675 million and sneaker specialty retailer Stadium Goods.

If Farfetch buys Barneys out of bankruptcy, it plans to only keep the Madison Avenue flagship and its store in Beverly Hills, sources said. Barneys had been hoping to retain five stores, according to its bankruptcy filing, and has begun closing eight stores in Chicago, Las Vegas, Seattle and elsewhere.

The nearly century-old department store is owned by hedge fund billionaire Richard Perry, whose wife, Lisa Perry, designs clothing prominently featured in the stores.

In announcing the bankruptcy, Barneys executives have said they plan on keeping the company alive by securing a buyer for it. A $75 million loan it secured in bankruptcy gives Barney’s until late October to find a buyer.

Farfetch, which trades on the New York Stock Exchange, also did return a request for comment.