Humanity creates a new technology that discovers these strange crystals (on Earth) that produce a little bit of electricity. There's now a race for mining them, and the whole world is going crazy over them.
Some said that World War 3 started, but it wasn't huge. Countries were fighting over that amazing source of energy.
The collected crystals were studied and used as a reliable source of energy. Things were looking out great for the countries who got most of them, but all countries had some of that power, even if it wasn't much.
Lots of people are dying with the war for the crystals. A solar storm begins, starting the Solar Apocalypse. Electric things stop working, but the weird crystals just unleashed massive amounts of energy, exploding everything around them.
Most people living in cities die. There is too much desperation to get basic needs and a lot of people were killed by the massive explosions of the crystals.
Animals that lived cast away in the sewers now could go up and eat whatever they wanted, as there were no people to spray them with poison.
The world becomes a much more dangerous place, as the predators drastically increase their population by eating livestock.
In the end, only about 5 to 15 million people survive. They rebuild, though. The strange crystals can be used for "magic", now that they are "on". The surviving humans are slowly changed by magic and with the power of time there are now lots of different races in the world. The most advanced are in a medieval-like period, but with magic. The magic is highly grounded on science though, so no crazy things.
How much time would it take for human society to rebuild itself? It can't be too little like one thousand years, as one would still be able to find the ruins of the old world if they looked hard enough. I don't think it can be too much time like more than ten thousand years, as they probably would have advanced more with magic.