Former Spain big man Juan Antonio Orenga, who had assisted Scariolo and also served as the U20 head coach, has taken the reins.
He will lead the two-time defending champions at next year’s EuroBasket in Slovenia.
The Spaniards already have a place at the 2014 FIBA Basketball World Cup secure as the host nation.
The length of Orenga’s contract was not announced.
Spanish Basketball Federation President Jose Luis Saez said: “For us, it was crucial to call on someone who has experience and Orenga has a lot of experience.
“He has worked with Aito (Garcia Reneses) and Sergio.
“There are many good coaches out there but out choice was Orenga.”
After leading Spain on a bumpy ride to the gold medal in Poland, Scariolo thanked the federation for giving him the keys to the Ferrari.
Pau Gasol, Marc Gasol, Juan-Carlos Navarro, Rudy Fernandez, Jorge Garbajosa, Felipe Reyes, Sergio Llull and Ricky Rubio were among those to play in Poland, when Spain had to overcome early setbacks to Serbia and Turkey to win their first European gold.
With Pau Gasol choosing to rest in 2010, Scariolo guided Spain into the Quarter-Finalsof the FIBA World Championship in Turkey, where they were upended by a long three-pointer from Serbia’s Milos Teodosic at the buzzer.
Serge Ibaka became a key man in the Spain squad by 2011 in Lithuania, and Scariolo’s team stormed to the gold medal with only one loss, to Turkey, in the first round.
This past summer, Scariolo did not have a fully fit Navarro for the London Games but the Barcelona star came good in the gold-medal clash with Team USA and helped Spain push the Americans to the end for the second time in a row at the Olympics.
“I don’t know if I’m more emotional now than four years ago when I sat here and took the reins of the national team,” said Scariolo on Wednesday night.
“I didn’t think it would be four years of enrichment in many respects.
“I told Pepe (Saez) on the flight back from London that I thought the time had come (to step down).
“We gave each other a couple of months of distance to think it over.
“I think this (stepping down) is the right decision.
“It will allow me to spend more time with my family and I think it will give the national team a new challenge.
“I can only have words of thank you.
I want to thank the president for giving me the opportunity and my players for the great discipline they always showed.
“I can only say that I have tried with all my strength.”
“My personal view is positive. I feel a better coach and a better person than I was four years ago.
“I think this was the right time to take this decision.”
When asked if he would consider coaching the national team again, he didn’t rule out the possibility.
“It is very complicated for a coach to make long-term plans,” he said.
“My future is to be coach. But I don’t make long-term plans.
“I coach a club right now and I’m devoted to it.
“We will see what happens in the future.”
As for the appointment of Orenga, Scariolo said: “I have only good words for Juan.
“He has been a great collaborator. He is a loyal, hardworking, intelligent man. He has helped me a lot.
“He has a clear vision.”
Saez paid tribute to Scariolo.
“I have a lot of fond memories of the time we spent together,” he said.
“It wasn’t an easy time when you took over.
“The success we’ve had has been mostly thanks to your professionalism.
“I have not been able to convince you but I respect your decision.
“You have been loyal to your job and to the federation.
“This will continue to be your house.”