It was about 1:30 Friday morning, and WMAL-TV reporter Neal Friedman was getting tired of hanging around the mayor's command post in the police department and waiting for some kind of statement. So he ambled about 700 feet down the hall and stood outside elevators near the police department's own command post.

Suddenly Iranian Ambassador Ardeshir Zahedi burst out of the room and headed for an elevator. "What's going on?" Friedman asked him. "They're releasing the hostages within the hour," Zehedi answered. And because Friedman happened to be where he was at that moment, WMAL-TV scooped its competition by 15 minutes in reporting an end to the long, tense, 39-hour ordeal that press in other cities wer e calling "the siege of Washington."

If the siege was over - the Hanafi Muslims and their captives leaving the three sites where they had been trapped together since early Wednesday - the news story was not. And the immediate concern of TV and radio reporters at the scene was a scramble for hostages who could give first-person accounts on the air.

So when the hostages filed out of the Foundary Methodist Church where they had been reunited with waiting friends and relatives, they confronted another small army, one with flashing strobe lights, out-thrust microphones and shouted questions.

The hostages, many pale and weak from the strain, shrank from the glare of lights while print and broadcast reporters and camera crews swarmed around them for vantage points. There was shoving and elbowing. Hostages who ran were literally chased by cameramen. Some hid their faces behind their coats and sweaters to avoid the cameras.

One hostage's husband punched a photographer in he face while the wife, in tears, shouted, "Animals! Animals!" at the journalists.

It was not the media's proudest moment. But coverage of the two-day ordeal had been a series of frustrations, complexities, logistical problems and anxieties about precipitating events as well as reporting on them for the city's radio and television stations. Some of them had linked hostages, captors and their audiences, by telephone, during the siege.

The siege brought with it a blurring of the line between reporter and participant. So that by mid-day yesterday, WTOP's Max Robinson, who broadcast the first conversation with Hanafi leader Hamaas Abdul Khaalis, had received by telephone two offers from publishers for him to write a book, one offer from a man volunteering to be his agent for book and film projects - and a threat on his life from an anonymous caller.

"I'm not saying I won't write a book but I've got to think about this a long, long time," Robinson said later yesterday. "I don't want to feel I'm exploiting this for my career or for myself personally."

WTOP won the race to get a hostage in its studio and on the air when Alan Grip, a former WTOP newsman himself, arrived at the station for a special 8 a.m. show yesterday and they stuck around for the station's "Nine in the Morning" program. A reporter from WMAL was waiting in the WTOP lobby for Grip when he emerged from that broadcast.

While Grip was on the air, WTOP-TV news director Jim Snyder was called by the D.C. police who told him Grip was "violating the agreement that led to the freeing of the hostages" by appearing on the air. Snyder refused to yank Grip off but agreed to inform Grip, during a break, what the police were claiming. Grip decided to stay on the air.

"I wasn't part of any agreement," said Snyder. "I think what the police were doing amounted to overreaction."

Relationships between the police and the media were not always harmonious during the siege, but most news officials complied with police requests to withhold information that might aggravate the raiders and endanger hostages.

"I think we played ball this time with the police department," WTOP reporter Mike Buchanan told viewers early Friday morning.

Anchorman Gordon Peterson agreed. "And I just refused to use inflammatory words like 'terrorists' in describing the Muslims," he said. Peterson explained yesterday that he had received several phone calls from viewers telling him, 'Why don't you call them what they are - terrorists, guerrillas, kidnappers,' and so on.

"But we knew these people (the Muslims) were listening, and we just didn't want to do anything to trigger them," said Peterson. "That was always on my mind."

WMAL-TV news director Sam Zelman said yesterday he thought some of the police requests to withhold facts were "far-fetched and silly" but that he complied with most of them. He said he felt no need to honor a request not to broadcast news that some city employees had barricaded themselves in the District Building unknown to the raiders because the fact had already been published.

"We ran it," Zelman said. "To me, there was no reason not to. I hate to sound rabbinical about this, but in a free society, information helps people cope with problems and it helps prevent wild problems and it helps prevent wild rumors. A newman's business is to provide information. If officials want information withheld, they should withhold it at the source, not come to us."

Questions about the ethics of over-covering or under-covering the story were frequent - especially the idea that reporting on terrorist activity encourages more of it, with publicity on live TV a seductive reward.

Fred J. Hacker, an expert on international terrorism, declared, "It can hardly be denied that the news media is a major influence in the spread of these sorts of incidents. Television especially is a medium of contagion," Hacker said. "It is obvious that what is being shown is also being imitated. Television sells deodorants and breakfast food; why wouldn't it sell violence?"

"We've been played as heavies in this thing," anchorman Peterson told viewers Friday morning, "but I don't know what choice we had." Later, Peterson said the station received many calls from people complaining about oo much covereage of the incidents.

"We had debates on that ourselves," said Peterson. "But if we shut up, it isn't going to go away, and the man in charge might do something even worse to get attention if he isn't getting it already."

WRC-TV news director Bruce MacDonell praised his own stall yesterday - as did news directors at all local stations - but complained that some unnamed reporters were passing along hearsay and rumor potentially dangerous.

Sometimes speculation outran facts. WTOP radio broadcast reports Thursday night of a group of motorcyclists "who might be Hanafi Muslims" heading for the Grammercy Hotel, near the besieged B'nai B'rith headquarters. The "unconfirmed report" went out over the air.

Three minutes later, according to WTOP general manager Peter Lund, the station had to report that the motorcyclists were not Hanafi Muslims at all but instead official escorts for the diplomats engaged in negotiations with police and the raiders.

As local broadcasts were disrupted, local broadcasts distrupted areas surrounding the hostage sites. Camera trucks for live remote reports clogged the blockaded streets around Scott Circle and the tiny park across from the District Building. The normally sedate neighborhood of baronial homes and embassies along Massachusetts Avenue near the Islamic Center was trampled and littered by media crews, some of whom dropped fried chicken boxes, soft-drink cans and discarded movie film as the vigil went on.

Staff members at the nearby Indian embassy reponded to the invasion by offering free curry lunches to the reporters occupying their phone books and racing down their hallways.

But when the reporters also decided to occupy an apartment building at 2540 Massachusetts Ave. NW, Maj. Gen. (Ret) Charles Holle, 72, a resident there, threatened to convene a meeting of other tenants and urge them to vote to evic the media. This never came to pass.

Neither the police nor the media knew exactly how much access hostages and captors had to TV and radio broadcasts, nor who was listening to whom. Hostage Grip, an aide to Councilman Sterling Tucker, said after being freed that the Muslims "told us what station to listen to" on an available radio in the District Building.

The first day they listened to WRC radio and the second to WTOP. Both are "all-news" stations.

Grip said he was not "troubled" by the coverage he hears. "Nothing I heard troubled me, but there was constant worry that someone would say something that would set these guys off." He said he head a lot of "misinformation they had was troublesome."

A TV set in the office where Grip was held was turned on only twice, for about 15 minutes each time, Grip said. "It may have been that in order to watch TV, they could not watch us," said Grip.

He also said he was alarmed as the apparent end of the siege drew near and radio reporters offered "too much speculation about a happy outcome" for the hostages. "I didn't want them to hear that," Grip said. "I was afraid what it might do to the guy with the gun. He might just see he end coming and say "To hell with it' and kill someone."

But news directors said they exercised all possible restraints, while at the same time not taking everything police told them as ultimate truth. "I'm not aware of anything we did or not do that amounted to handing our jounalistic jewelry over to the police," said WTOP's Snyder. "Or of anything we did that made their already difficult job more difficult. The media in town did a good job on this one."