Toys ‘R’ Us CEO executives lined their pockets with company funds on the eve of the troubled retailer’s 2017 bankruptcy — to the tune of $16 million, an explosive new lawsuit claims.

Days before the company behind Geoffrey the Giraffe filed for bankruptcy protection in September 2017, chief executive David Brandon and other Toys ‘R’ Us execs scored bonuses that boosted their total pay by 75 percent, the lawsuit said.

Brandon pocketed $2.8 million, the suit claims. By contrast, the toy seller’s vendors barely received 20 cents on the dollar in the company’s bankruptcy.

The New York State lawsuit was filed Thursday by a group of creditors dubbed the TRU Creditor Litigation Trust. They are seeking $1.1 billion in damages, claiming a fraudulent scheme to bilk them out of billions.

The suit said Brandon began arranging for the board-approved bonuses a few months before the bankruptcy, in July 2017, as Toys ‘R’ Us’ losses were mounting, the suit said.

“We have to be creative and design something that works for us,” Brandon allegedly said in a July 2017 e-mail, referring to the existing executives’ pay plan, which Brandon noted was already frothy compared to industry peers.

It claims Brandon’s only qualification to be CEO of Toys ‘R’ Us was his loyalty to Toys ‘R’ US backer Bain Capital, a private equity firm known for its ties to US Sen. Mitt Romney (R-Utah).

The lawsuit cites e-mails showing Brandon boasting about Bain letting him invest in their funds and deals without charging him the same fees “required for institutional investors or higher net worth investors than me.”

Brandon, who is currently a director of Domino’s Pizza, a Bain-backed company, did not return requests for comment.

The suit also blasts Toys ‘R’ Us’ former chief merchandising officer Richard Barry — president of the new Toys ‘R’ Us firm that owns the trademark to the iconic toy company — for fraudulently misleading toy manufacturers to send the company merchandise before the company filed for bankruptcy protection.

When toy executives including MGA Entertainment CEO Isaac Larian asked Barry about rumors that Toys ‘R’ Us would liquidate rather than reorganize, he denied it, according to the complaint.

“We are going to have a big year together!!” Barry wrote to Larian in January 2018, the lawsuit said. Two months later, in March 2018, the company announced that it would close all of its US and British stores as part of a liquidation process.

“At all times, the former directors and officers of Toys ‘R’ Us and members of management acted in the best interests of the company and its stakeholders,” the directors’ lawyer Bob Bodian said in a statement. “Because none of the named defendants has any financial exposure, this lawsuit is just a misguided effort to pressure insurance carriers to pay meritless claims. We will defend against this baseless lawsuit vigorously.”

“The toy makers want a public trial and for these executives to be confronted with what they did,” said the plaintiff’s lawyer Greg Dovel of Dovel & Luner.