Computer maker Gateway Inc. said Tuesday that it had agreed to repurchase stock held by America Online Inc. for $315.6 million.

AOL, which is a unit of media and entertainment company Time Warner Inc., invested $800 million in Gateway in 1999. Gateway has marketed AOL service to its customers, and the two have shared revenue from the subscriptions.

Gateway said it will pay $185.6 million in cash and give AOL a $130 million credit under their revenue-sharing agreement for the shares, which include preferred stock and 2.7 million common shares.

The deal is scheduled to close Dec. 22. AOL may initially keep up to 3.5 million common shares of Gateway.

Gateway shares closed down 8 cents, or 1.4 percent, at $5.72 Tuesday on the New York Stock Exchange. The stock traded around $60 when the alliance was announced in 1999.

Gateway has roughly 373 million shares outstanding.

Gateway also said it agreed to a $200 million, five-year revolving credit with an unidentified financial institution.

The Irvine-based company said it is considering other refinancing alternatives to increase its overall working capital.

Gateway Inc. will pay America Online $315.6 million to repurchase stock owned by the Time Warner Inc. subsidiary.