A U.S. grand jury in Alexandria has accused two men of conspiracy in connection with threatening letters mailed to District Judge Oren R. Lewis and other U.S. officials, a federal prosecutor said yesterday.

A sealed, nine-count indictment returned Monday and made public yesterday named Robert Johnson of Hyattsville and Melvin Davis, a prison inmate convicted earlier this year on a related charge, as the alleged conspirators.

Johnson, 34, was arrested yesterday at his home and was ordered held without bond by a U.S. magistrate in Hyattsville.

Johnson also is known, the indictment said, by the Muslim alias of Muhammad Abdul Malik. Court documents gave Davis' alias as Khalid Abdul Latif.

According to law enforcement officials, the threats were contained in letters to Lewis, assistant U.S. Attorneys Nash Schott and E. Lawrence Barcella, Norman Carlson, head of the U.S. Bureau of Prisons, and two of Carlson's assistants, James Meko and Gary R. Mote.

Schott was involved in the prosecution last winter of two black American Muslims convicted of buying weapons under false pretenses from a Warrenton gun dealer.

FBI agents who raided the suburban Maryland home of one of the men, Musa Abdul Majid, also known as Derrick Pritchett, found spent shell casings later linked by tests to the same gun used in the July 1980 assassination of Ali Akbar Tabatabai in Bethesda.

Majid was sentenced as a fugitive last January to three consecutive three-year prison terms by Judge Lewis..

According to yesterday's indictment, the alleged conspiracy began last summer, around the time a shot was fired at Carlson's Fairfax County home. Four days later, on Aug. 18, shots also were fired at Meko's residence in the Washington area. There were no injuries in either incident.

One count of the indictment charged Johnson with conspiracy to murder Carlson -- apparently growing out of last summer's shooting incident -- and Schott. Davis was named as an unindicted coconspirator in that particular charge.

Both men are accused of conspiracy in the writing of a series of threatening letters to Schott and Lewis, a federal judge of senior status in Alexandria.

Davis and Johnson also were charged in three separate counts with sending threatening communications to Schott and Carlson. A federal prosecutor said the messages included threats to members of Schott's family.