Astronauts from the Space Shuttle Atlantis, in what might be the most complex repair job in NASA history, yesterday completed the first of five days of repairs on the aging instrument.

Mission specialists John Grunsfeld and Andrew Feustel replaced the telescope’s deep-space camera and main computer during a grueling, seven-hour spacewalk.

It’s a dangerous undertaking; the mission’s location — 350 miles above the Earth — leaves the crew prone to collisions with space debris.

A second shuttle — Endeavour — is ready for launch at Cape Canaveral, Fla., to rescue the Atlantis crew, if needed.

But the mission is worth the risk.

The Hubble telescope, first launched in 1990, has been arguably NASA’s most far-reaching project to date: Unobstructed by the Earth’s atmosphere, it’s been able to peer deep into space, revealing key clues to the origins of the universe.

The latest repairs, if successful, should give the telescope another five to 10 years of life.