SAN DIEGO (AP) _ The world's largest Internet service provider and a leading seller of made-to-order personal computers have reached an agreement to market and distribute each other's products.

America Online and computer giant Gateway Inc. announced the alliance Wednesday.

As part of the two-year deal, AOL will invest $800 million in cash and equity securities into San Diego-based Gateway Inc.; $180 million of that in AOL stock.

Gateway will spend $85 million to feature and market AOL products and services on its PCs.

In trading this morning on the New York Stock Exchange, AOL was up 1.3 percent, or by $1.56 1/4 at $119.56 1/4 a share, while Gateway soared 11.3 percent, or by $5.87 1/2 to $57.87 1/2.

Besides sharing subscribers and directing customers to each other's electronic commerce sites, the companies plan to share operating profits on customers from online software sales and Gateway's Internet training courses.

AOL, based in Dulles, Va., has a base of 18 million members and another 2 million subscribers through its CompuServe subsidiary. Gateway has 5 million customers and 180 stores nationwide.

The companies will collaborate on an online software store marketed to its customers, and offer the computer and Internet training programs for AOL subscribers who own Gateway computers.

Gateway is the leading direct seller of computers to consumers.