A defendant interrupted his trial in U.S. District Court yesterday to plead guilty to charges he conspired in sending death threats to U.S. officials investigating the assassination of Iranian dissident Ali Akbar Tabatabai.

The sudden change of mind by Melvin Lee Davis, also known as Muhammad Abdul Malik, came on the second day of testimony in Alexandria about execution threats allegedly meant to halt the probe of a group called the Islamic Guerrillas of America, which has been linked to the 1980 Tabatabai slaying.

Davis, who pleaded guilty the day after a federal prosecutor testified that he had cooperated with the FBI since his arrest, gave no reason for his action.

Assistant U.S. Attorney Nash Schott said Davis implicated his codefendant in the Alexandria trial, Robert Lee Johnson, in an August 1980 incident in which shots were fired into the Fairfax County homes of Norman Carlson, director of the U.S. Bureau of Prisons, and James Meko, a Carlson aide.

Prosecutors said Davis, who pleaded guilty in May to participating in the shooting episodes, was himself the subject of a threatening letter sent to Carlson about the time of Davis' plea.

"We now sic all about your rat . . . " the May 20 letter to Carlson said in part. "Send Davis to federal penitentiaries at Lewisburg or Leavenworth unless you value his life more than your wifes sic ."

Carlson, who testified he understood the term "rat" to refer to an informant, said Davis was assigned instead to a federal correctional facility at Lake Placid, N.Y.

The letter, signed by the "I.G.A.," identified in testimony as the Islamic Guerrillas of America, a revolutionary group to which both Davis and Johnson allegedly belonged, ended with the statement: "Your wife looked good in the cream and blue she wore on the last visit to the hairdresser. Think about it."

District Judge Richard L. Williams set sentencing for Davis for Jan. 15. The six counts of conspiracy, obstruction of justice, mailing threats and intimidating a federal officer carry a maximum penalty of 31 years in prison and $18,000 in fines.

The prosecution said two assistant U.S. attorneys assigned last year to the Tabatabai investigation - Schott and E. Lawrence Barcella - received mail threats. Also threatened were U.S. District Judge Oren R. Lewis and Sen. Strom Thurmond (R-S.C.), according to prosecution testimony.

Schott said he first received a threatening letter in the mail in January after successfully prosecuting five or six Muslims accused of buying weapons in Virginia under false names.

One of those convicted, Derrick Pritchett, also known as Musa Abdul Majid, has been identified by prosecutors as "the fourth man" in the team of pro-Ayatollah Khomeini Muslims who participated in the plot that culminated in the fatal shooting of Tabatabai at his Bethesda home.

Majid is a fugitive and believed to be in Iran, Schott said on the witness stand.

The January letter mailed to Schott warned, " . . . you will watch the loves of your life beheaded around you . . . " if Schott continued "to speak out against our glorious leader . . . " It added: "And tell your honorable Oren Lewis he won't make it until this summer. This is law!"

Prosecution witnesses yesterday included two former cellmates of Davis in the Fairfax County Jail who said Davis drafted some of the threats, then smuggled the texts out by having them copied by an unidentified visitor. Both men said Johnson, also known as Khalid Abdul Latif, visited Davis often and that the two talked frequently on the telephone.