Anthony Joshua will have the chance to avenge his shock defeat to Andy Ruiz Jr before the end of the year.

Joshua's promoter, Eddie Hearn, said a deal has been clinched that will see the rematch take place in November or December.

Joshua lost his WBA, IBF, IBO and WBO heavyweight belts after a shock seventh-round TKO at the hands of challenger Ruiz at Madison Square Garden in New York on Saturday.

The new fight deal was struck in accordance with what Joshua and trainer Rob McCracken wanted, Hearn indicated.

The 29-year-old British boxer said immediately after his division-shaking defeat that he wanted to tackle Ruiz again, and Hearn confirmed a clause has been triggered that will mean he gets his wish.

Hearn wrote on Twitter: "After meetings with AJ, Rob Mc and the management team in NY, we have today triggered the contracted rematch clause with Andy Ruiz Jnr. The fight will take place in Nov/Dec at a venue to be confirmed shortly."

California-born Ruiz indicated before Hearn's announcement that he would relish taking on Joshua in Mexico, where Ruiz's parents are from.

"I know deep down the pain he is feeling is going to drive him in the next camp and will drive him hopefully to regain those world title belts," Hearn told Sky Sports News.

"Everyone is searching for answers about why AJ lost rather than giving Andy Ruiz the credit. On the night he was the better man and we've got to make sure that come the rematch AJ is the better man."