A federal judge yesterday ordered the FBI to file with the National archives all of its tapes and documents growing out of buggings and wiretaps of slain civil rights leader Martin Luther King Jr.

The materials cannot be made public for at least 50 years, except by court order, according to the ruling.

U.S. District Court Judge John Lewis Smith Jr. issued the order in dismissing two civil suits filed against the FBI by Bernard S. Lee, a former assistant to King, and the Southern Christian Leadership Conference, which King headed until his assassination in April, 1968.

The suits sought money damages from the FBI for the buggins. They alleged the FBI secretly recorded King's conversations in a Willard Hotel room here in 1963 and sent a copy of the tape to Mrs. King, as well as bugging other conversations.

In addition, the suits claimed copies of those recordings and others were played for members of the news media as part of an attempt to discredit King.

Judge Smith dismissed the suit because they were not filed within the three-year statute of limitations.

The last reported bugging had occurred in 1968, and Smith said numerous newspapers had carried reports about the buggings beginning early the next year. The suit was not filed until after the Senate Select Committee on Intelligence made its official report on the incidents in 1975.

The Senate committee found that the FBI had installed 15 bugs in King's hotel rooms and that one tape recording was mailed to King shortly before he received the Nobel Peace Prize in 1964. Accompanying the tape was a letter saying, "Your end is approaching . . . you are finished."

King's associates interpreted the message as an effort to induce the civil rights leader to commit suicide.

Attorneys for Lee and the SCLC said in court papers that they did not file the suit earlier based on the newspaper reports because "in all candor, who would have believed in those pre-Watergate days, the nation's gangbusters would have been involved in the kind of nonsense alleged here?"

Smith's order impounding the FBI records of the King buggings specifically includes all tapes, transcripts and logs concerning any such surveillances of King in Atlanta, New York, or any hotels, or motels in which he stayed between 1963 and 1968.

The FBI must provide the judge an inventory of the materials within 90 days and provide the material to the National Archives in that time.