Ushba Tesoro produced a remarkable run, coming from the back of the field under Yuga Kawada, to take the Dubai World Cup for Japan.
The early pace in the 10-furlong showpiece, worth $12million, was strong and it set up for closers.
Bendoog looked comfortable under Christophe Soumillon with Saudi Cup winner Panthalassa, who had been drawn wide, in company early on.
Yet when they turned for home, James Doyle aboard the Simon and Ed Crisford-trained Algiers looked the likely winner and went a length clear with a furlong and a half to run.
But the imposing Ushba Tesoro (9-1), who had won five of his six starts since being switched to the dirt, ignored the kick-back as he circled the field and with a blistering turn of foot, ran down Doyle's mount to win going away by two-and-three-quarter lengths.
After recording Japan's second success in the race, following Victoire Pisa in 2011, winning trainer Noboru Takagi said: "I thought he would be in with a chance at the 100-metre mark.
"Yuga is one of the best riders in Japan, so it was a no-brainer to go with him today.
"It is an amazing feeling to have won a race like this. We will talk to the owners and decide on his future going forward.
"After his last race the Dubai World Cup was always in our sights."
Kawada, having his first ride aboard the six-year-old son of Orfevre, said: "I am so very happy.
"It is an honour to be here. He won and I am so happy. I am so proud of him.
"He'd trained very well and it was a matter of how he adapted.
"I'm very proud of my horse and myself for winning the greatest race in the world."
An owner representative for Ryotokuji Kenji Holdings said: "This was a complete team effort and the victory is for the effort of every individual in this team.
"This was the first win abroad for our syndicate and now we've opened our doors to the global stage we will look again.
The owners expressed an interest in going for the Prix de l'Arc de Triomphe if we won this today."
Last year's winner Country Grammer never looked like giving Frankie Dettori another famous victory in his last season, on what was the final Dubai ride of his career.
"I think it was just a bridge too far," said Dettori. "He had a hard race in Saudi and left it there.
"When I pulled him out there wasn't the usual spark, but what a horse he's been to me.
"At least I got one on the night and can go and have a nice cold beer now."
Of Algiers, Ed Crisford said: "He ran with great credit. James gave him a beautiful ride. He jumped well and turning in I thought we had it in the bag, but the last furlong he was just treading water a bit.
"Probably he just got outstayed with the tempo of the race, but huge credit to the horse and my team at home and we should be proud. He ran his race there if not better."