The longtime head of NASA’s human spaceflight programs has been replaced as the agency races to meet President Trump’s ambitious goal of returning American astronauts to the Moon in five years, a major shakeup that has stunned the space community.

William Gerstenmaier – known within the agency as simply "Gerst" – started working at NASA in 1977 as an engineer and rose to the rank of associate administrator for human exploration and operations in 2004. But according to NASA Administrator Jim Bridenstine, it’s precisely those bona fides that earned him the boot.

WATCH FOX NEWS CHANNEL FOR A LIVE BROADCAST FROM THE KENNEDY SPACE CENTER JULY 20 FROM 12-2 PM EST.

“He's been at NASA for 42 years and we love him, and in fact, we have an opportunity now to land on the Moon in the year 2024 because of the hard work that he has put into the program,” Bridenstine said of Gerstenmaier in an exclusive interview with Fox News. “But sometimes we need to remember, he started working at NASA when I was 2 years old, and there comes a time in every career when it's time to move on.”

When pressed about what specifically earned Gerstenmaier his demotion, Bridenstine said, “I don’t think there’s anything that he was not doing. I just think it’s time for new leadership.”

House Science, Space and Technology Committee Chairwoman Eddie Bernice Johnson, D-Texas, said she is baffled by the decision to abruptly remove someone with Gerstenmaier’s level of institutional knowledge.

“The Trump Administration’s ill-defined crash program to land astronauts on the Moon in 2024 was going to be challenging enough to achieve under the best of circumstances. Removing experienced engineering leadership from that effort and the rest of the nation’s human spaceflight programs at such a crucial point in time seems misguided at best,” said Johnson.

For months, the Trump administration has been blunt about its frustration with the space agency’s track record of running over budget and behind schedule.

“NASA must transform itself into a leaner, more accountable, and more agile organization,” Vice President Mike Pence said in March when he announced the new moonshot program. “If NASA is not currently capable of landing American astronauts on the Moon in five years, we need to change the organization, not the mission."

APOLLO 11: NASA AND THE 'LOST' MOON LANDING TAPES

The organization changed Wednesday night when Gerstenmaier and his top deputy, Bill Hill, were reassigned to special assistant positions. Former NASA astronaut Ken Bowersox was named acting head of human exploration, but Bridenstine is launching a nationwide search to find a permanent replacement.

“We are moving fast to go to the Moon. We need a new generation of leaders that will step up and move out on the objective,” Bridenstine said.

Rep. Johnson argued the open search is a sign the shakeup was poorly conceived.

“You don’t change horses in mid-stream, or if you try to do so, you better have the other horse ready to go,” Johnson said.

NASA’s new moonshot program is named Artemis because it is the "twin sister" to the Apollo program that achieved the first lunar landing 50 years ago next week. (In ancient Greek mythology, Artemis and Apollo were the twin offspring of the god Zeus and the goddess Leto.)

Bridenstine insists that Gerstenmaier was on board with Artemis’ accelerated timeline.

CLICK HERE TO GET THE FOX NEWS APP

“He helped us create this timeline. He gave us the guidance that this was achievable,” said Bridenstine. “In fact, we have a chance to land [on the Moon] in 2024 because of his efforts.”

But those efforts were not enough for Gerstenmaier to keep his job. When asked if any other organizational changes were in the works, Bridenstine replied: “Not at this time.”