The testimony given yesterday by Attorney General Edwin Meese III to the Iran-contra committees was preceded by long hours of preparation during the last two weeks, according to Justice Department officials.

Meese has been closeted with a group of close advisers, led by Assistant Attorney General William Bradford Reynolds, who have peppered the attorney general with questions about his knowledge of arms shipments to Iran and his investigation last November after the sales came to light. That investigation has long been the target of critical barbs from committee members. For example, Sen. Warren B. Rudman (R-N.H.), vice chairman of the Senate panel, has called it "a case of gross incompetence."

Terry Eastland, Meese's principal spokesman, estimated that the attorney general spent 20 to 30 hours preparing for his testimony, including his deposition and his earlier appearance before the Tower commission and the two intelligence committees. Others described that estimate as low.

Another official said Meese spent about 4 1/2 hours Sunday, "the better part of the morning" Monday and "a good segment of the afternoon" discussing his testimony. At the witness table yesterday, Meese displayed considerable mastery of the elaborate record already produced in the Iran-contra investigation.

At the Justice Department yesterday, Meese's testimony was the story of the day.

Eastland -- who for weeks has been fielding reporters' questions about the Iran-contra affair and the Wedtech scandal, in which Meese has also been embroiled -- accompanied his boss to the hearings.

Patrick Korten, deputy director of the public affairs office, spent the day watching Meese on television, with orders to his secretary to hold his calls until the close of the hearings.

"It's like a day off," said one official who does not work on the Iran-contra matter.

Last week, top department officials were preoccupied with photocopying masses of documents subpoenaed by independent counsel Lawrence E. Walsh. "It's incredibly onerous on people who are trying to do business," said a senior department official. "We've got a lot of people around here who are doing that {copying} rather than governing the Justice Department."

Eastland dismissed suggestions that Meese was distracted or that his influence had been eroded by the twin probes. He recited a string of substantive decisions Meese has made in recent months and noted that Meese had found time Monday to open the new Justice Department cafeteria, with a chef imported from the FBI across the street. Meese went to the opening but did not eat lunch there, Eastland said.

When The Washington Times reported Friday that investigations into Meese's finances and other Wedtech fallout "could cost Mr. Meese his job," Meese called Washington Times editor Arnaud de Borchgrave to denounce the story as "high-grade gossip, not news."