John W. “Jack” Townsend Jr., 87, a NASA physicist who helped establish the Goddard Space Flight Center in Greenbelt and retired in 1990 as its director, died Oct. 29 at Sibley Memorial Hospital in the District.

He had lung cancer, said his wife, JoAnn Clayton Townsend.

Mr. Townsend joined the U.S. Naval Research Laboratory in 1949 to work on early space experiments. When NASA was created in 1958, he and his research group moved to the new administration, where Mr. Townsend became chief of the space sciences division.

Mr. Townsend helped select the Greenbelt location for the Goddard Center and helped determine the direction of the research that would take place there, said Frank McDonald, a NASA scientist who worked closely with him.

McDonald said Mr. Townsend established a research group on the construction of spacecrafts and supervised scientists working on launch vehicles. Mr. Townsend served as the center’s deputy director from 1965 to 1968 and insisted that Goddard invest in research related to astronomy, solar physics and other space sciences.

Mr. Townsend subsequently became deputy administrator of the U.S. Environmental Science Services Administration, which later became the National Oceanic and Atmospheric Administration.

Beginning in the late 1970s, he worked for about a decade in the private sector and held senior positions in the space division of Fairchild Industries, an aerospace company, and with its parent company.

After the explosion of the Challenger space shuttle in 1986, NASA recalled Mr. Townsend and other experienced former administrators. After working briefly at NASA’s headquarters, he became Goddard’s director in 1987.

Mr. Townsend was a member of the National Academy of Engineering and the International Academy of Astronautics and was a fellow of the American Institute of Aeronautics and Astronautics.

His honors included two distinguished service medals from NASA.

John William Townsend Jr. was a native Washingtonian and a 1942 graduate of Woodrow Wilson High School. During World War II, he served in the Army Air Forces in the Pacific.

He earned a bachelor’s degree in 1946 and later a master’s degree, both in physics, from Williams College in Massachusetts.

When he was 16, Mr. Townsend got a pilot’s license and a ham radio license. He kept both until shortly before his death. A train hobbyist, he built steam locomotives that carried three people.

His first wife, Mary Lewis Townsend, died in 1986 after 38 years of marriage.

Survivors include his wife of 15 years, JoAnn Clayton Townsend of Cabin John; three children from his first marriage, Bruce Townsend of Hyattsville, Nancy Townsend of Salisbury, Md., and Megan Townsend of Glen Burnie; two stepchildren, David Clayton of Yarmouth, Maine, and Diana Clayton of Rockville; and six grandchildren.