Brazil's Cosan, the world's largest ethanol and sugar processor, said on Monday it signed an agreement to merge its ethanol and fuels distribution business in the country with Royal Dutch Shell in a deal valued as much as $12 billion.

Cosan said it has 180 days to discuss the non-binding memorandum of understanding exclusively with Shell International Petroleum Company Ltd.

As part of the transaction, Cosan will transfer to the merged entity its sugar, ethanol, fuels distribution and energy generation business, with assets valued at $4.925 billion and debt of $2.524 billion.

Cosan said Shell will contribute its retail fuels and aviation distribution business and will inject about $1.625 billion into the merged company in up to two years. Cosan will contribute another $300 million in cash over five years.

(Reporting by Elzio Barreto; Editing by Hans Peters)