Juan Andres Mejia, 39, a Spanish instructor and soccer coach at St. Albans School for Boys in Washington since 1971, died of cancer Sunday at Georgetown University Hospital.

Mr. Mejia taught all levels of Spanish at St. Albans and also had been chairman of the school's language department. Soccer teams he coached won four Interstate Athletic Conference championships. He also had served as a school dormitory master.

The class of 1978 dedicated their yearbood to him for "his enthusiasm for learning, for his ability to inspire others with that enthusiasm, and for his commitment to teaching more than a language."

Mr. Mejia, a native of Medellin, Colombia, came to this country in 1957 and attended public school in West Chester, Pa. He earned a bachelor's degree in economics at Drexel University and a master's degree in Spanish literature at Middlebury College. He taught in Pennsylvania before moving to Washington in 1971.

Survivors include his wife of three years, the former Constance Corbett, of Washington; his parents, Andres and Ligia Mejia, both of Washington; two brothers, Luis Javier Mejia of Colombia and Fernando Mejia of Charleston, S.C., and five sisters, Maria Teresa Mejia of West Chester, Marta Ines Mejia de Vansquez of Colombia, Ligia Van Horn of Havertown, Pa., Olgas Mejia Sullivan of Washington and Monica Mejia of Charleston, S.C.

The family suggests that expressions of sympathy be in the form of contributions to The Hunger Project, c/o St. Albans School, Washington, D.C., 20016.