The Italian jockey rode nine English Classic winners for Godolphin and partnered the great Dubai Millennium to glory in the Dubai World Cup of 2000.
Godolphin's racing manager Simon Crisford said: "We have had a tremendous association with Frankie over many years. He has achieved so much.
"However, Frankie is looking for a fresh challenge and we felt that the retainer was not really working so this is the best way forward.
"We have had many great days together and we look forward to working with Frankie in the future and hopefully enjoying more success together.
"He remains a great friend - the difference next year will be that he will not be our retained jockey and will operate as a freelance instead," he told www.godolphin.com.
Dettori, who rode Godolphin's first Classic winner, Balanchine, in 1994 and has been associated with many of the stable's top horses since then, said: "I have had 18 wonderful years.
"Godolphin has been a major part of everything I have achieved in racing and I have loved every minute of it.
"I feel the time has come for a change. My position in the stable has changed a little bit and I need a new challenge.
"Sheikh Mohammed [bin Rashid, Vice President of the UAE and Ruler of Dubai] has been an unbelievable boss to me. He had the confidence to take me on board when I was young and we smashed every record together.
"I will be forever grateful to him for everything he has done for me and for my family."
Dettori, the winner of 110 Group or Grade 1 races in the royal blue silks, thanked the many Godolphin staff who had helped him to achieve the success he has enjoyed with the stable.
"The whole team have been fantastic - none of it would have been possible without them," he said.
Godolphin's retained riders in 2013 will be Mickael Barzalona and Silvestre de Sousa.
Dettori's name has been among those linked as possibles to be named the retained jockey to the increasingly powerful Pearl Bloodstock and Qatar Racing.
Asked about speculation over a retained rider, David Redvers, the racing manager, said: "I think I will be in a position to make an announcement at the end of the week."
Most of Dettori's big-race winners have been trained by Saeed bin Suroor, including four of those that formed the rider's "Magnificent Seven" at Ascot on September 28, 1996.
Speaking from Milan where he watched Dettori finish second on Godolphin's Retrieve in the Group 1 Gran Premio Del Jockey Club Italiano at San Siro yesterday, Bin Suroor said: "We have been good friends and have travelled all over the world and have had great times. We have been like brothers.
"He has done a great job for Godolphin. It is sad but at the same time I wish him good luck.
"He is the best jockey in the world and I am sure he will do well also in the future."
Dettori's latest big-race success before yesterday's announcement came on Joshua Tree, trained by Marco Botti, in the Grade 1 Canadian International at Woodbine last Sunday. Botti intends to make full use of Dettori's availability as a freelance next year.
He said: "He's definitely a top-class jockey. I'm sure we'll have the opportunity to use him next year on the right horses."
Follow us @SprtNationalUAE