Emperor Napoleon III of France offered a prize to anyone who could make a satisfactory butter alternative, suitable for use by the armed forces and the lower classes. French chemist Hippolyte Mège-Mouriès invented a substance he called oleomargarine, which became shortened to the trade name margarine. Mège-Mouriès patented the concept in 1869 and expanded his initial manufacturing operation from France but had little commercial success. In 1871, he sold the patent to the Dutch company Jurgens, now part of Unilever. In the same year a German pharmacist, Benedict Klein from Cologne, founded the first margarine factory "Benedict Klein Margarinewerke", producing the brands Overstolz and Botteram.

More Info: en.wikipedia.org