We present the abundance analysis of a sample of more than 120 red giants in the globular cluster (GC) NGC 1851, based on FLAMES spectra. We find a small but detectable metallicity spread. This spread is compatible with the presence of two different groups of stars with a metallicity difference of 0.06-0.08 dex, in agreement with earlier photometric studies. If stars are divided into these two groups according to their metallicity, both components show Na-O anticorrelation (signature of a genuine GC nature) of moderate extension. The metal-poor stars are more concentrated than the metal-rich ones.We tentatively propose the hypothesis that NGC 1851 formed from a merger of two individual GCs with a slightly different Fe and α-element content and possibly an age difference up to 1 Gyr. This is also supported by number ratios of stars on the split subgiant and on the bimodal horizontal branches. The distribution of n-capture process elements in the two components also supports the idea that the enrichment must have occurred in each of the structures separately and not as a continuum of events in a single GC. The most probable explanation is that the proto-clusters formed into a (now dissolved) dwarf galaxy and later merged to produce the present GC.