Bernard J. Cahill, 71, a retired foreign trade official with the Commerce Department who was active in civic affairs, died of a lung ailment Thursday at the Fairfax Nursing Center. He had been hospitalized since April 20, when he was struck by a car and received head injuries.

Mr. Cahill, who was born in Alameda, Calif., graduated from the University of California at Berkeley. He moved to Washington in 1939 and joined the Labor Department as an economist. He later worked for the War Production Board and then served in the Army in Europe during World War II.

After the war, he worked briefly for the Civilian Production Administration and then joined Commerce. He specialized in Latin American trade and from 1958 to 1960 was a commercial attache with the U.S. Embassy in La Paz, Bolivia. At the time of his retirement in 1975, he was the director of emergent markets in the Latin American division of the Office of International Marketing.

Mr. Cahill, who lived in Arlington, was a past president of the Donaldson Run Civic Association. He also was a past president of the Donaldson Run Recreation Association, a swimming club.

Survivors include his wife, Alice, of Arlington; three children, Susan Cahill-Aylward of Alexandria, Stan, of Annapolis, and Laura, of Arlington, and two grandchildren.

The family suggests that expressions of sympathy be in the form of contributions to a charity of one's choice.