BERLIN — Europe’s Rosetta space probe has located its lost Philae lander, wedged in a “dark crack” on a comet, the European Space Agency said Monday.

Rosetta’s camera finally captured images on Friday of the lander on comet 67P/Churyumov-Gerasimenko, weeks before the probe’s own mission ends, the agency said . The pictures showing the lander’s body and two of its three legs were taken as Rosetta passed within 2.7 kilometers (1.7 miles) of the surface.

After being launched in 2004, Rosetta took 10 years to accelerate and catch up with comet 67P. In November 2014 it released Philae, achieving the first landing of a spacecraft on a comet.

Philae bounced after its initial touchdown and its precise location on the comet couldn’t be pinned down until now, though its general vicinity was known.

After sending data to Earth for three days its battery ran out and it went into hibernation, only to recharge enough as the comet came closer to the sun to communicate briefly with Rosetta in mid-2015.

ESA plans to crash Rosetta into the comet Sept. 30, because the probe is unlikely to survive lengthy hibernation in orbit as the comet heads away from the sun.

Data from Rosetta and Philae have already improved scientists’ understanding of the nature of comets and the role they played in the early universe. Analyzing the data fully is expected to keep researchers busy for years.

“We were beginning to think that Philae would remain lost forever,” said Patrick Martin, ESA’s Rosetta mission manager. “It is incredible we have captured this at the final hour.”

Rosetta project scientist Matt Taylor said that locating Philae provides missing information “needed to put Philae’s three days of science into proper context.”