Mercury is most commonly extracted from an ore called cinnabar. It's heated to produce mercury vapour and that is then condensed to produce liquid mercury.
It was produced in Peru and Mexico and Spain but I believe the production was in Almaden in Spain stopped a few years ago. Now China and Russia are large source of mined mercury.
The majority of the EU's mercury now comes from the Chlor-alkali industry that used large stocks of mercury in the production of chemicals but is now converting to other technologies and returning their stocks to the market.
http://www.greenfacts.org/en/mercury/l-3/mercu ry-5.htm