Joseph G. Gavin Jr., who rode herd over the immensely complex design, construction and testing of the first manned vehicle to land on the moon — a task that included anticipating 400 different landing surfaces, from ice to boulders to dust to potholes — died on Saturday in Amherst, Mass. He was 90.

The cause was acute leukemia and pneumonia, his family said.

When President John F. Kennedy declared in 1961 that America would go to the moon by the end of the decade, the task seemed almost unbelievably daunting. But tens of thousands across America pitched in, and Mr. Gavin had one of the most important roles, as part of the Apollo 11 mission.

An M.I.T.-trained engineer who had worked on early jet aircraft engines during World War II, Mr. Gavin managed the 7,500-member team that made the Eagle, the clunky lunar module that settled on the lunar surface, in a spot called the Sea of Tranquillity, on July 20, 1969.

“Houston, Tranquillity Base here,” Neil A. Armstrong, the Apollo 11 commander, announced to mission control as half a billion people watched on television. “The Eagle has landed.”