The rare and awe-inspiring spectacle of a total solar eclipse unfolded over parts of Indonesia and the Indian and Pacific Oceans, around midday Wednesday local time. Thanks to clear skies, the full eclipse was visible to several million people within its narrow path, including eclipse chasers who travelled from around the world for a chance to witness it.

Solar eclipse

Here is a view captured at 8:20 p.m. ET with a hydrogen-alpha filter. This allowed scientists to see a prominence, or arc of gas, with a diameter five times that of Earth's. (Exploratorium/NASA)

Solar eclipse

Cameras captured a 'diamond ring' effect within seconds of totality of the eclipse, as the sun's light began to return, at 8:43 p.m. ET. (Exploratorium/NASA)

Europe Africa Week in Pictures

The last total solar eclipse was in March 2015 and best viewed from Norway's Svalbard islands near the North Pole. The next one will be visible in Indonesia starting 7:20 a.m. local time Wednesday in the Sumatran city of Palembang (7:20 p.m. ET Tuesday.) (Haakon Mosvold Larsen/NTB Scanpix/Associated Press)

One of the best locations to view the eclipse was in Palembang, the second-largest city on Sumatra island.

The rare astronomical event was witnessed along a narrow path that stretches across 12 provinces encompassing three times zones and about 40 million people. In other parts of the Indonesian archipelago and Asia, a partial eclipse was visible.

Scientists set up about two tonnes of gear on the Woleai Atoll in Micronesia in order to captured images from start to finish.

People on the ground were able to witness totality under clear skies around 8:43 p.m. ET (12:43 p.m. local time).

What causes a total solar eclipse?

At least twice a year, the orbits of the moon and Earth result in the moon casting a shadow on the Earth that blocks the sun. Most eclipses are partial but when the moon is close enough to the Earth, the sun is completely eclipsed and only a faint ring of rays known as the corona is visible. The last total solar eclipse was in March 2015. The best reported viewing was on Norway's Svalbard islands near the North Pole. The previous total eclipse was in November 2012.

Where was the eclipse visible?

The total eclipse was visible within a roughly 100 to 150 kilometre (62-93 mile) -wide path that begins in the Indian Ocean and slices across parts of Indonesia including Sumatra, Kalimantan and Sulawesi before ending in the northern Pacific Ocean. Indonesia's capital, Jakarta, was not within the eclipse path, but the Sumatran port city of Palembang with a population of more than 1.4 million is. Cloudy skies could have made the much anticipated event a disappointment, but for the most part skies were clear over the best viewing locations. About 15 minutes before totality, clouds threatened to block the sun, but they soon parted.

The astronomy news service Slooh.com, was streaming the event online in a broadcast starting 6 p.m. ET hosted by astronomer Paul Cox and a team from the Institute of Astrophysics of the Canary Islands, who will answer questions from the public.

How long did the eclipse last?

The entire eclipse, which begins with the first patch of darkness appearing on the edge of the sun, was to last about three hours. For the viewer, the exact duration of the total phase of the eclipse depended on their location along the path. The moments in which the sun was entirely obscured lasted jusst a few minutes.

Palembang in Sumatra was the first major city to see the total eclipse, at about 7:20 a.m. local time (7:20 p.m. ET). The position at which the total eclipse lasted the longest, 4 minutes and 9 seconds, is in the Pacific Ocean east of the Philippines. On land, the durations were mostly between 1 and 3 minutes.

If you're watching online, NASA said the period of total eclipse, called totality, was to occur from 8:38 to 8:42 p.m. ET. The agency was only a minute off; totality occurred at 8:43 p.m. ET.

Was the eclipse safe to look at?

It is dangerous to look at the sun with the naked eye during a partial eclipse, the partial phases of a total eclipse and another type of eclipse called the annular eclipse, particularly using devices such as telescopes.

Germany Europe Solar Eclipse

King Willem-Alexander of the Netherlands smiles after he watched the solar eclipse through special glasses at the Fish Market in Hamburg, Germany, Friday March 20, 2015. It is dangerous to look at the sun with the naked eye during a partial eclipse, the partial phases of a total eclipse and another type of eclipse called the annular eclipse. (Christian Charisius/Associated Press)

Optometrist and eclipse chaser B. Ralph Chou, who helped develop international standards for filters, wrote that those coated with a fine layer of aluminum, chromium or silver such as the darkest welder's glass and filters made of aluminized polyester in the darkest shades are safe. The filters should be specifically designed for the binoculars and telescopes that they will be fitted to.

Another safe but cumbersome and probably unsatisfying method of viewing is pinhole projection of the image onto a screen. Unsafe filters include color film, black-and-white film that contains no silver, photographic negatives with images, smoked glass and sunglasses even if multiple pairs are worn. During the spectacular moments of total eclipse it is safe to look at the sun with the naked eye.

How did Indonesia prepare?

Authorities had been promoting the eclipse as a tourism event locally and internationally since 2014. Because of their rarity, total eclipses are a magnet for scientists and eclipse chasers. Overseas tour agencies had chartered ships for groups who wanted to view the eclipse at sea and many land tours, which are the best for photography, were also organized. Oklahoma-based Spears Travel says a group led by a former NASA scientist was booked on a special Holland America Line cruise that included people from Canada, the U.S., Britain, China and Iran.

An eclipse festival wasplanned for Palu, the capital of Sulawesi province, and 11 cities in total were being promoted as places where the total eclipse could be clearly viewed.