A star-crossed mission nearly 20 years in the making that was intended to seek an answer to the most burning, baffling question in astronomy — and perhaps elucidate the fate of the universe — is in danger of being canceled.

The Wide-Field Infrared Survey Telescope, or Wfirst, was being designed to investigate the mysterious force dubbed dark energy that is speeding up the expansion of the universe and search out planets around other stars.

In 2010, a blue-ribbon panel from the National Academy of Sciences charged with charting the future of space-based astronomy gave the mission the highest priority for the next decade. Under the plan, it could have launched in mid-2020s with a price tag of $3.2 billion.

But it was zeroed out in the NASA budget proposed by President Trump last week.

In a statement accompanying the budget, Robert M. Lightfoot Jr., the agency’s acting administrator, called the deletion “one hard decision,” citing the need to divert resources to “other agency priorities.” NASA is shifting its focus back to the moon.