Accused spy Ronald W. Pelton acknowledged in court testimony today that during an interview with FBI agents he answered questions about his contact with Soviet officials even after he signed a statement showing that he had been informed of his rights.

Pelton, a former National Security Agency employe who was arrested at the end of that interview Nov. 25, testified during a hearing in U.S. District Court here in which his lawyer is seeking to have his alleged confession to the agents suppressed. Pelton said that during morning talks with the two agents he became convinced that the FBI was interested in having him do counterintelligence work, either in electronic surveillance or as a double agent.

But when he returned for an evening session with the agents, Pelton said, he began to suspect that they were trying to get him to talk about his activities so they could use that information to prosecute him. Even after realizing he was probably about to be arrested, he said, he signed a waiver of his rights and continued to answer questions about contacts with and payments he received from Soviet officials.

"It just didn't register," he said of the waiver of his rights to remain silent and to have legal counsel present, which he signed at 11:25 p.m. after hours of talks. "I was tired and I wanted to get it over with."

When asked by his lawyer if he expected to be arrested, Pelton replied, "Yes," but he still had "some hope" that the government wanted to use him in counterintelligence.

He said, however, that he resisted the agents' questions about what kind of classified information he allegedly sold to Soviet agents. While they pressed for a damage assessment "quite heavily . . . I don't think I made any admissions . . . . I skirted that as best I could."

Pelton, 44, was a communications specialist with the highly secret National Security Agency for 14 years. He is accused of selling the Soviets extremely sensitive information about U.S. intelligence-gathering systems directed at the Soviet Union. His alleged contacts with Soviet agents occurred during a five-year period beginning in 1980, the year he left the NSA.

Pelton's lawyer, Fred Warren Bennett, argued to have Pelton's statements to the FBI withheld during his trial because he was not advised of his rights in a timely manner and that agents coerced his statements by making him think he would not be prosecuted.

In addition, Bennett sought to show that Pelton was impaired during his evening talks with the agents because during the afternoon he had injected Dilaudid, a narcotic akin to heroin, and consumed more than half a bottle of vodka.

The agents who interviewed Pelton testified that he appeared to be in full control that evening. A narcotics expert testified today that the Dilaudid would not have impaired Pelton's thought processes and that the drug's effects would likely have worn off by the time he met with agents for the second time.

Prosecutors contend that Pelton mistakenly assumed he could talk about payments and trips to meet Soviet officials and escape prosecution as long as he did not disclose what intelligence information he allegedly sold.

Three times during the morning and evening interviews, Pelton said, he refused to answer questions about an intelligence project he allegedly disclosed to the Soviets at their embassy in Washington in 1980.