But Mr. Ellison is also a friend of Mr. Jobs. And Mr. Jobs, who did not clinch the deal with Microsoft until 2 A.M., just hours before going on stage here to announce it, structured the agreement in a way that gives Apple continued autonomy as it tries to recover from a plunging market share and $1.7 billion in losses over the last seven quarters.

As a giant video screen beamed in the live image of Mr. Gates from Microsoft's headquarters in Redmond, Wash., Mr. Jobs chided those in the audience who responded with catcalls while explaining the Microsoft deal. ''We want to let go of this notion that for Apple to win, Microsoft has to lose,'' Mr. Jobs said. ''We better treat Microsoft with a little gratitude.''

For Apple, there would seem to be little to lose by cooperating with Microsoft as long as Apple remains autonomous. And antitrust experts predicted the Government would have no problems with the deal because it gives Microsoft only a small stake in Apple and no voice in the board room.

Still, the size of Microsoft's $150 million investment -- worth only 4.5 percent of Apple's stock market value, which at the end of the day was $3.3 billion -- is not nearly as significant as the vote of confidence it represents, coming as it does from the PC industry's dominant software company. Apple did not disclose its plans for the investment.

Investors responded by sending Apple's shares up $6.5625 today, to $26.3125, their highest since May 1996, and making the stock the day's most heavily traded, with more than 37 million shares exchanged. Microsoft rose 12.5 cents, to $143.4375.

Apple is ''still in the tunnel, but at least we can see the light,'' said Charles Wolf, an Apple financial analyst at Credit Suisse First Boston.

One of the company's big investors, Prince Walid bin Talal of Saudi Arabia, who bought more than 5 percent of Apple last April, said by telephone that he was studying Apple's announcement today and declined to comment.