Twice, the Baltimore Orioles couldn't have asked for a better situation and twice Cal Ripken, their best hitter this year, felt the frustration he rarely has to deal with.

The Orioles trailed by five runs when the ninth inning began, then threatened another astonishing comeback. But Ripken popped up with the bases loaded to leave the California Angels with a 5-3 victory in Anaheim Stadium.

Many of the 26,594 had departed for the beaches after Ripken's hard double-play grounder had ended a two-on, one-out eighth inning. Even Manager Gene Mauch of the Angels said, "I thought we'd be in the clubhouse with the game over before we'd see Ripken again."

But in the ninth, Fred Lynn hit a two-run homer off tiring Ron Romanick (6-1) to make it 5-2. That brought on Donnie Moore, the most unhittable reliever in the American League lately. Moore, who is tied for the league lead with 10 saves, had a 0.64 ERA.

He walked Larry Sheets, retired Joe Nolan and Fritz Connally, then allowed singles to pinch hitter Wayne Gross and Lee Lacy to load the bases.

When Moore walked Jim Dwyer it was a 5-3 game and Moore had given up his first earned run in 25-plus innings over 16 games.

So the bases were still loaded and up came Ripken, Baltimore's leader in runs batted in. He remembered later that he was standing on deck "wishing I had a chance to get to the plate, because that would mean the tying runs on base in scoring position."

Moore threw him several 90-mph-plus fast balls over the outside portion of the plate. "He kept fouling them off," Moore said, "so (catcher) Bob Boone called for one inside, and it jammed him."

Ripken said he was guarding against a change-up. He popped up to short right field to end the suspense. "Sometimes you come through and sometimes you don't," said Ripken, who has come through more often than not.

"We turned the corner when we got to our leadoff man (Lacy)," Manager Joe Altobelli said. "We had them nervous. I was just sitting there hoping Rip would hit the hell out of the ball someplace."

Mauch agreed that the Orioles had an ideal situation with Ripken at bat, but added, "As it turned out, better him than Gross or Lacy, today. I always expect the best to happen. It doesn't always, but I expect it."

What he hadn't expected was Moore to be so shaky. Moore said he "wasn't quite ready" when he came in because he was surprised that Romanick had been removed.

Although Ripken came into the game hitless in his previous 15 at-bats and had only one hit in five trips today, Moore said that didn't make it any easier to face him. "I wanted to get out in the bottom of the batting order and never see him," Moore said.

Dennis Martinez (3-3) made only one real mistake, but took the loss for allowing three earned runs in seven innings. His reliever, Nate Snell, got out of a jam in the seventh inning to keep Baltimore within three. But Snell, whose 2.23 ERA was the staff's best, gave up two runs in the eighth.

"Nate's been going good for so long," Altobelli said, "I guess we found out today that he's human."

The Angels could have opened up a big lead early, when they loaded the bases with nobody out. But Martinez got Bobby Grich to ground into a double play that allowed California only a 1-0 lead.

The Orioles were set to go ahead, 2-1, in the fifth, when Lenn Sakata hit a drive to right-center that looked certain to go all the way to the wall. Runners on first and third would have scored, but right fielder Mike Brown made a phenomenal diving catch that ended the inning.

Martinez made his big mistake in the sixth. With one out, he hit Brian Downing. "But it wasn't even that far inside," Martinez said. "He's so strong, he's willing to get hit to intimidate the pitcher."

Martinez didn't say whether he was intimidated. But Ruppert Jones did put a high fast ball just inside the right field foul pole to give California a 3-0 lead.

Snell, a sinker-ball specialist, came on with the bases loaded in the seventh and got Juan Beniquez to ground into a double play. "Snell's the guy I like to have to get a ground ball and he does it again," Altobelli said.

But Snell gave up an RBI single to Jerry Narron and an RBI double to Brown, putting the Orioles behind, 5-0.

It even appeared Baltimore would be shut out for the first time since Sept. 21, until Murray led off the ninth with a single to right, and started the drama.