SAO PAULO, Brazil (AP) _ Cosan, Brazil's largest sugar and ethanol producer, announced Thursday it has signed a contract to buy Exxon Mobil Corp.'s distribution and service stations in Brazil, a deal worth US$826 million (524 million).

Cosan Industria e Comercio SA said it has agreed to buy 100 percent of Exxon's subsidiary Esso Brasileira de Petroleo Ltda. and will assume a debt of US$163 million (103 million).

The Brazilian company said it will finance part of the acquisition with US$310 million (196 million) recently raised with a private share deal. It said the funds will not come from the company's New York Stock Exchange initial public offering last August or be diverted from its core sugar and ethanol business.

"This gradual transition of operations will allow Cosan to choose the best moment to access local and international capital markets in order to optimize the capital structure and protect shareholder interests," the company said in a statement.

Cosan will buy 1,500 gasoline stations in 20 Brazilian states, making it the fifth-largest chain and accounting for about 7 percent of the total fuel distribution market.

The acquisition also includes a lubricants plant in Rio de Janeiro and a majority stake in a lubricants terminal in Duque de Caxias. The company signed a long-term contract to use the Esso brand in selling lubricants.

Cosan said the purchase was strategic. "It's vital we secure a distribution channel for our ethanol," vice president for finance and investor relations Paulo Diniz told the Agencia Estado news service.

Entering the market without buying an established brand would have been extremely difficult under current market conditions, said Nelson Rodrigues, an oil analyst with Banco do Brasil in Rio de Janeiro.

"It makes perfect strategic sense for Cosan. It guarantees them a distribution channel for their ethanol," Rodrigues told Dow Jones Newswires.

Ethanol prices currently are falling in Brazil, but the volume of ethanol sold is rising fast.

More than 85 percent of new car sales in Brazil are flex-fuel models that can run on any mixture of ethanol with gasoline. As ethanol currently is cheaper than gasoline in Brazil, most flex car owners opt for ethanol.

Cosan shares were down 2 percent on Sao Paulo's Bovespa exchange in late afternoon trading to 26.54 reals (US$16.04; 10.17).

Exxon Mobil is headquartered in Irving, Texas.

Copyright 2008 The Associated Press.