Pictures of the International Space Station as it passes in front of the Sun or Moon are a bit of a feather in the cap of space photographers – but Arizona-based astrophotographer Andrew McCarthy bagged a real prize.

When he headed out to the Sonoran Desert and set up his equipment to attempt to capture an ISS transit, he was surprised by a medium-sized solar flare in the background. The resulting image captured not just the space station as it whisked past the surface of the Sun, but the transient appearance of a solar eruption.

"This is one of my favorite shots of all time due to the fleeting nature of these solar flares and the ISS transits," he wrote in an Instagram post.

To be very clear, the ISS was not in danger from the flare. The space station orbits Earth at an altitude of about 400 kilometers (about 250 miles); it was nowhere near the Sun when the eruption took place. Solar flares can increase the radiation to which astronauts are exposed, and can pose a threat to electronic systems, but they generally come and go without incident.

Related: Hubble Catches Incredible 'Photobomb' of an Asteroid Streaking Past Crab Nebula

The ISS orbits Earth once every 90 minutes or so, which, if you're lucky, may create an opportunity for a photo of a transit: as it passes overhead, the Sun or the Moon will, very briefly, be behind it. You need luck and skill to capture this eyeblink moment; it's a fun challenge for astrophotographers.

McCarthy is known for his stunningly detailed pictures of the Sun and Moon, captured by snapping tens of thousands individual images and stacking and compiling them to create views that lay bare the sheer power and beauty of the Solar System.

For this image, McCarthy used multiple telescopes, cooling them with ice packs and coolers as a barrier against the Arizona desert heat.

"This is a composite mosaic, as I continued shooting the Sun after the transit to fill in the entire full disc in extreme detail," he explained of his new image. "The negative space has some elements composited in from the 2024 eclipse to transition the chromosphere to black, which aides [sic] in telling the story of everything happening on the Sun."

McCarthy has named his image Kardashev Dreams, after Soviet astronomer Nikolai Kardashev, who proposed the Kardashev scale of measuring technological advancement. The image, McCarthy hopefully notes, exemplifies "our first steps to being a much greater civilization".

You can follow McCarthy on Instagram, X, Facebook, and his website. And if you want to have a crack at photographing an ISS transit, you can use Transit Finder to find one.