A former State Department officer from Prince George's County was sentenced to six months in jail yesterday for mail fraud, embezzlement and converting government money for his own use while stationed at a U.S. mission in eastern Africa.

Walter F. Costello, 34, a former Foreign Service officer for the Agency of International Development in Somalia, was convicted Feb. 20 in federal court in Alexandria on three charges relating to a 1980 embezzlement scheme in which investigators said he deposited government checks totaling $25,000 into his personal bank accounts and then invested the money in the international black market.

AID officials said it is unusual for U.S. Foreign Service officers to trade on illegal foreign markets. But AID Inspector General Herbert L. Beckington said yesterday the Costello conviction should send a warning to the estimated 16,000 State Department employes abroad.

"It is tempting and easy" for Americans abroad to exchange U.S. dollars on the profitable illegal markets, Beckington said, "but it will not be tolerated."

Costello was indicted Dec. 19 on 27 counts of mail fraud, embezzlement and converting government money on the Somalian black market for his personal gain. U.S. District Court Judge Albert V. Bryan, Jr. yesterday sentenced Costello to five years in prison, with all but six months suspended, for three of those charges.

The judge also placed Costello, who has been free on $10,000 bond since December, on three years probation.

Costello returned the money to the government's account after depositing it in his own accounts and allegedly making a profit, Assistant U.S. Attorney Clarence H. Albright, Jr., said. The prosecutor said he had no evidence that the government suffered any financial loss.

The State Department fired Costello after his conviction last month.