OCEANPORT, N.J., AUG. 1 -- The most eagerly anticipated horse race of the year turned into the most exciting race of the year, as Bet Twice won the Haskell Invitational Handicap today in a breathtaking three-horse photo finish.

The colt held off Alysheba, his archrival throughout the Triple Crown series, by a neck, with Lost Code just another neck behind.

It was an ennobling performance for all three. The time of 1:47 for 1 1/8 miles was only one-fifth of a second slower than Monmouth Park's track record. Bet Twice evened his season record against Alysheba -- each has won two meetings -- but Alysheba may have proved something more important. He showed he can run effectively without the anti-bleeding medication Lasix, which trainer Jack Van Berg chose not to use today.

The critical moment in the Haskell -- one which Alysheba's jockey Chris McCarron will surely be replaying in his mind -- came when the three contenders turned into the stretch.

Lost Code and Bet Twice were running one-two, with Alysheba just behind them on the rail. As they swung into the short Monmouth stretch, Lost Code drifted a bit wide, and Alysheba had an opening in front of him. But McCarron chose to angle Alysheba off the rail, losing momentum he didn't regain until it was too late.

"I was going to try to get through the hole," McCarron said, "but the hole was moving faster than I was." If he had gotten through, the outcome of the Haskell almost certainly would have been different.

The early running of the Haskell had set the stage of that crucial moment, and as Bet Twice's jockey Craig Perret would explain afterward, none of it was an accident.

Before the race, Perret was worrying more about Lost Code, the colt who had won seven straight races and had the superior speed in the field. He told trainer Jimmy Croll, "The track is favoring speed. We can't let him get away from us."

McCarron had been thinking just that. So when Lost Code popped out of the gate and went to the lead, as expected, both his principal rivals were hustling to stay close -- a distinct change from the strategy in the Triple Crown series. Alysheba broke from the post just inside Bet Twice, and the two raced abreast as they pursued Lost Code. Alysheba was pinned on the inside, just what Perret had hoped.

"When he'd beaten us {in the Kentucky Derby and the Preakness}, he'd done it on the outside," Perret said. "I don't think Alysheba was where he liked to be today."

Van Berg agreed with Perret's assessment. "If he had been on the outside of Lost Code," the trainer said, "he would have won."

Lost Code got away with setting a relatively slow pace for the first half-mile, fractions of :23 3/5 and :46 3/5; his rivals never let him get more than two lengths in front. But as they reached the turn, the pace quickened, and Lost Code couldn't take the pressure.

"He ran his eyeballs out," jockey Gene St. Leon said. But Lost Code, from the stable of one-time Maryland trainer Bill Donovan, showed he is not quite good enough to beat the best horses of his generation. If he couldn't do it as the lone speed horse in a field of five, he probably never will.

Alysheba and Bet Twice were to prove, during the stretch run, that they are the same consistent, tough competitors they had been throughout the Triple Crown series. When Alysheba swung wide into the stretch, he seemed to shift into another gear and accelerated strongly at Bet Twice. For a moment, it appeared he would be able to catch the leader, but Bet Twice held his ground as he equaled the fastest previous running of the Haskell.

The tight finish today set the stage for a rubber match on Aug. 22 in the $1 million Travers Stakes at Saratoga. It will be the most eagerly awaited race of 1987 -- since the Haskell.

Perret probably summed up the popular view when he said, "I love to compete with these horses. Three weeks is too long to wait."