On December 21, 1968, Frank Borman, Jim Lovell and Bill Anders took off aboard Apollo 8 to become the first humans to orbit the moon. The Apollo project was a nationwide effort made up of more than 400,000 people spanning various industries and organizations. These organizations included MIT, whose pivotal role helped make the mission possible.

Apollo 8 wasn’t supposed to happen. Not in 1968, anyway. The original plan was to have the crew do another test orbit of Earth, but as it turned out, NASA was behind schedule. The lunar module — the small spacecraft used to land on the moon, just wasn’t ready in time. So, in a seemingly counterintuitive measure, NASA moved up the more challenging mission of sending three men outside of Earth’s orbit for the first time.

Fred Martin, who was a software manager at MIT’s Instrumentation Lab at the time, recalled that some people were horrified at the idea.

“They said, ‘We’d never be ready, that isn’t what our intention was’ and so on,” he said. “And then others thought, you know, we did the Apollo 7 test. Everything seems to be okay. The software is in place. You know, why not?”

There was also a Soviet threat to contend with. CIA intelligence at the time indicated Russia was going to send a man to the moon before the end of the year. Bear in mind, when President Kennedy made a sweeping proclamation to advance the space program seven years earlier, there was a geopolitical motive — to avoid war with the Soviet Union. Instead, the United States would beat the Russians to the moon.

Fred Martin, formerly of the MIT Instrumentation Lab. Cristina Quinn / WGBH News

Martin's group at what is now known as Draper Lab wrote the in-flight software used in Apollo’s Guidance Computer. It was a small but vital team.

“I thought that we could do this. I thought that everything was in place to do it. So when they decided to go, we took that in stride,” Martin said.

The decision came after the Instrumentation Lab had spent four years honing its inertial navigation technology and figuring out how to shrink a computer into one cubic foot — a computer that could withstand a trip inside what essentially was a missile hurtling into space. Martin and his team, which included the lead software engineer Margaret Hamilton, were tasked with creating code the astronauts would use to navigate the moon without the help of ground control in Houston.

“There was a tremendous amount of testing that went on all the time,” Martin said. “What would happen if the thrust was only 90 percent of it? Or what would happen if this came late? Or what would happen if you're off trajectory or you had too much drift in the inertial measurement system — or, or, or. And then you'd see whether the software was robust enough.”

The previous year, three astronauts were killed during a rehearsal for the launch of Apollo 1, so Martin and his team found themselves in the odd position of exercising caution while simultaneously racing against time. They ran tests every night for nearly four months, accounting the potential for error every step of the way.

What they were attempting was unprecedented, said Debbie Douglas, director of collections at the MIT Museum.

“The Apollo Guidance Computer was a milestone in computing technology in many ways. Its size, its use of integrated circuits of chips, of the clever way of using core rope memory.” Douglas said.

How that core rope memory was made is unthinkable today. After all those tests had shown the software was solid, the code was shipped off to a Raytheon facility in Waltham. There, a group of women manually threaded the code, running copper wires through tiny magnetic rings. They were literally hardwiring the memory. It was time — and labor — intensive.

And it was tough, Martin noted.

“In the end, that memory was extremely reliable, extremely reliable, and even though it was very primitive, it was extremely robust,” he said.

The navigation system had to withstand any sort of disturbance — lightning, gamma rays, sunbursts, you name it, because once Borman, Lovell and Anders entered the far side of the moon, there would be "LOS"— loss of signal. There would be zero communication with ground control in Houston.

A copy of the telegram NASA sent to MIT's Instrumentation Lab about MIT's contract to make the guidance navigation system for the Apollo mission. Courtesy of Debbie Douglas

On Christmas Eve, everyone inside MIT’s Instrumentation Lab was watching.

“We were all in this room, the so-called scammer room,” Martin recalled. “And it might have had 100 people in it, sitting in chairs, and desks and a P.A. system that you could hear the conversation that was going on between CAPCOM and the astronauts.”

In Houston, one of the astronauts in Mission Control — CAPCOM — was counting down until LOS.

“Apollo 8, Houston, 1 minute ‘til LOS. All systems go.”

As the crew neared the far side of the moon, a man in Houston wished the astronauts a safe journey.

Amid a static crackle, Borman replied, “Thanks a lot, troops. We’ll see you on the other side.”

After those words, there was silence.

Borman, Lovell and Anders were now completely on their own for more than 40 minutes, with only the Apollo Guidance Computer to navigate their way. As time passed, Mission Control periodically tried to communicate with Apollo 8.

“Apollo 8 Houston. Over?”

Martin remembered the tension in MIT's scammer room.

“It was a nail biting period for everybody around the country. There was very little conversation that went on at MIT,” he said.

But then, a moment of relief fell over everyone when they heard CAPCOM excitedly announce that they had heard from the crew.

“We’ve got it, we’ve got it. Apollo 8 now in lunar orbit.”

Cheers erupted in the background.

“There’s a cheer in this room. This is Apollo Control Houston switching now to the voice of Jim Lovell.”

It worked. The Guidance Computer was accurate and precise, allowing the crew to orbit the moon ten times. A few days later, on Dec. 27, Apollo 8 splashed down safely in the Pacific Ocean. After a year of assassinations, unruly protests and growing cynicism about the costly space program, Douglas said the successful mission forged a moment of national unity.

“It's an experience that people have together that's not in words or visually, but it helps bind you together,” she said. “It helps define what it means to be American, what it means to be human, what it means to be a citizen.”

Correction: An earlier version of this story incorrectly stated that the Apollo 1 astronauts died at liftoff. They died during a rehearsal for the launch.