The blackout began at midday local time (05:00 GMT) and was slowly being restored nine hours on.
The failure was caused by technical issues, state power company PLN said.
Passengers on Jakarta's newly opened metro system were forced to evacuate with commuter trains also hit. Mobile phone networks were also affected.
Nearly 10 million people live in Jakarta, with a further 20 million living in the surrounding cities. Outages also hit neighbouring provinces, home to tens of millions more.
Jakarta, the fastest-sinking city in the world
Blackouts are frequent in Jakarta but Sunday's outage was unusually long.
The international airport in Jakarta was unaffected while hospitals used generators.
Traffic lights switched off in some areas of the capital, worsening congestion in a city notorious for traffic.
Ella Wasila, a train passenger told AFP: "The train stopped all of a sudden, we had to wait for a long time... There were so many babies in the coach, they were crying, and people were shouting 'open the door'."