The moon began to move between the Earth and sun at 6:19 am (2319 GMT Tuesday), and about an hour later a total eclipse became visible in western parts of the country.
The sun then went entirely dark in a broad arc right across the country, to the eastern Maluku Islands, before the eclipse swept out across the Pacific Ocean.
Indonesia to mark eclipse with tribal rituals, prayers
Partial eclipses were also visible over other parts of Asia and Australia, with schoolchildren in Kuala Lumpur donning special eclipse-viewing glasses to watch the spectacle and crowds gathering early in Singapore to witness the phenomenon.
Tens of thousands of foreign and Indonesian tourists have flocked to the best viewing spots, and special events were organised, from a festival to fun runs and dragon boat races.
"It was spectacular," said Daniel Orange, a 52-year-old American tourist from California, who was watching the total eclipse on the small western island of Belitung.
"It was very beautiful, there are a lot of people here and when the totality hit, everybody cheered. I got goose bumps."
In the popular viewing spot of Ternate, in the Malukus, thousands of people watching the spectacle on a beach cheered loudly and yelled "Glory to God".
On an island in the Mentawai chain, off Indonesia's main western island of Sumatra, hundreds cheered, prayed and hugged one another as the moon blocked out the sun.
In Singapore a crowd of about 400 people, including students and families, gathered at a university sports field to watch the partial eclipse, while groups of enthusiasts also converged on beaches and outside their highrise apartments to gaze upwards.
Magical views from top of the world for solar eclipse
Many came early with their cameras, long-range telescopes, and sunglasses.
For some of Indonesia's tribes, the eclipse is viewed with apprehension. In Palangkaraya, on Borneo island, Dayak tribesmen performed a special ritual to ensure that the sun, which they view as the source of life, did not disappear entirely.
As the total eclipse hit, the tribal chief -- dressed in a traditional costume -- began to chant loudly and was answered by even louder chants from other members of the tribe.
For many in the world's most populous Muslim-majority country, it was a spiritual experience, and large numbers flocked to mosques to say special prayers.
French tourist Arnaud Fischer, 33, an eclipse chaser who has witnessed the phenomenon around the world on numerous occasions, said Wednesday's was the best yet.
"It was extraordinary, it is the most beautiful of all the eclipses I have seen," he told AFP from Ternate. "The colours were magnificent, the whole horizon turned red."
The total eclipse swept across 12 out of 34 provinces in Indonesia, which stretches about 3,000 miles (5,000 kilometres) from east to west, before heading across the Pacific Ocean.
'Super blood moon' to give stargazers a rare show
It was visible for between just one-and-a-half to three minutes in most places.
As well as being seen in Sumatra, the eclipse travelled across Sulawesi, Borneo and the Malukus.
Foreign scientists also decended on Indonesia. A four-strong team from NASA was in Maba, a small town in the Malukus, to observe the eclipse.
The last total solar eclipse occurred on March 20, 2015, and was only visible from the Faroe Islands and Norway's Arctic Svalbard archipelago.
Total eclipses occur when the moon moves between the Earth and the Sun, and the three bodies align precisely.
As seen from Earth, the moon is just broad enough to cover the solar face, creating a breath-taking silver halo in an indigo sky.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ