Toys ‘R’ Us might have a white knight after all.

Its former chief executive from five years ago, Gerald Storch, is eyeing a deal that could save some stores before they shutter this summer, the distribution centers and most importantly the Toys ‘R’ Us trademarks as well as thousands of jobs, The Post has learned.

Storch, who was chairman and CEO of the company from 2006 to 2013, is in discussions with several venture groups that are considering buying the remaining parts of the storied retailer and bringing him on to the management team, a source with knowledge of the talks told The Post.

But the clock is ticking.

The linchpin of such a deal is the Toys ‘R’ Us portfolio of intellectual property assets, including its Babies ‘R’ Us name, domains and other trademarks associated with the 70-year-old company.

Those trademarks will be sold at an auction scheduled for June 18 at 10 a.m. at the New York City offices of Toys ‘R’ Us’ bankruptcy law firm, Kirkland & Ellis.

“It’s going to be really important who gets that intellectual property,” the source said.

About a month ago, Storch was seen at Toys ‘R’ Us headquarters by several people who reported the sighting to TheRockFather.com, a blog following the toy industry.

Storch declined to comment for this story.

His plan for Toys ‘R’ Us is to establish a new hub near the company’s Wayne, NJ-based headquarters to retain the top employees, many of whom have worked for the company for decades, said the source familiar with his thinking.

So far, about 150 of Toys ‘R’ Us’ 700-plus stores have been sold at an auction in April. Another auction including up to 150 additional stores is scheduled for June 11.

The rest of the US operations remains in play.

“Almost all of the pieces are left — the systems, distribution centers, stores, vendors — none of it is in anyone’s hands yet,” said the source, adding that the idea of acquiring the US operations would be “to buy all those things and put them back together really quickly.”

Interest in the trademarks and domains is high, sources say.

But Toys ‘R’ Us has already been warned that it has no right to sell any of the domain names associated with its former and now defunct subsidiary, KB Toys.

That brand is now owned by Strategic Marks, which bought it from the US Trademark office after Toys ‘R’ Us let it go dormant — and Strategic Marks is planning a major comeback for KB Toys, including opening 400 stores in malls by the holiday season.

Toys ‘R’ Us lists more than 60 iterations of the KB Toys domain name, that it hopes to sell on June 18, according to a bankruptcy court document.

“We are taking legal action to stop them,” Strategic Marks CEO Ellia Kassoff. said.