A rainbow of lunar transits as seen by NASA's Solar Dynamics Observatory. The observatory watches the sun in many different wavelengths of light, which are each colorized in a different color.

A NASA satellite has captured stunning views of a partial solar eclipse and a stormy eruption on the sun as seen from space, two amazing events that occurred on the same day last week..

The space agency's sun-watching Solar Dynamics Observatory saw the dual phenomena on Jan. 30, as this video of the solar flare and partial solar eclipse shows. During the solar eclipse, called a lunar transit, the moon took two and a half hours to cross —the longest transit ever recorded by the satellite.

A rainbow of lunar transits as seen by NASA's Solar Dynamics Observatory. The observatory watches the sun in many different wavelengths of light, which are each colorized in a different color. (Image credit: NASA/SDO)

The crisp silhouette of the moon creeps in front of the sun starting at 8:31 a.m. EST (1331 GMT), creating a partial solar eclipse from SDO's viewpoint. Near the end of the moon's crossing, a mid-level M6.6-class flare erupts from a giant cluster of sunspots that's been quite active recently. The flare peaked at 11:11 a.m. EST (1611 GMT), NASA officials said. [Photos: Biggest Solar Flares of 2014]

M-class solar flares are relatively medium-strength sun storms that can amplify Earth's northern lights displays when aimed at Earth. The most powerful solar storms, called X-class flares, can endanger astronauts in space and interfere with satellite operations in orbit when they are directly aimed at Earth.

The sunspot cluster that fired off the Jan. 30 solar flare is an area formerly called Region 1944, but now dubbed Region 1967. The same area unleashed the first major solar storm of the year, in the form of a huge X-class flare in January that postponed the launch of a private cargo mission to the International Space Station over fears of harmful radiation. (Orbital Sciences successfully launched its Antares rocket and robotic Cygnus spacecraft after the 24-hour delay.)

A solar flare erupts on Jan. 30, 2014, as seen by the bright flash on the left side of the sun, captured here by NASA's Solar Dynamics Observatory. (Image credit: NASA/SDO)

Solar flares occur when the twisted magnetic field lines in active regions of the sun cross and reconnect, creating powerful explosions. When pointed directly at our planet, intense solar flares can pose a threat to satellites, trigger radio blackouts and even put astronauts in orbit at risk.

The SDO spacecraft, which launched in 2010, is in a geosynchronous orbit that traces a figure-eight path every day and allows the satellite to keep a perpetual watch on the sun.

The moon passes between the $850 million Solar Dynamics Observatory spacecraft and the sun about two to three times each year, according to NASA. The outline of the moon appears sharp in the images because it has no atmosphere to warp the light from the sun, NASA officials noted.

Follow Megan Gannon on Twitter and Google+. Follow us @SPACEdotcom, Facebook or Google+. Originally published on Space.com.