The event, called a transit, occurs only about 12 times a century.
Mercury began the journey across the star's disc at just after 0510 GMT, depending on the viewing location on Earth. It slipped off the star's face at about 1032 GMT.
Some part of the five-hour trek was visible from the whole world except Antarctica and the western parts of the Americas. Europe, Asia and Africa were most favoured.
Skygazers without access to proper equipment were strongly recommended to watch the event only on the internet.
The websites of several organisations, including the European Southern Observatory (Eso) and the Solar and Heliospheric Observatory (Soho), which streamed the transit live, reported strong traffic.
THE PASSING DOT
Like thousands across the globe I watched the transit of Mercury with interest, and not a little wonder
The BBC's David Whitehouse
The planets Mercury and Venus are the only ones that appear to cross the face of the Sun, as seen from Earth, since both are closer to the star than the Earth is.
In the case of Mercury, transits occur either close to 7 May at intervals of 13 and 46 years or close to 9 November, which occur more frequently at intervals of 7, 13 and 46 years.
Venus transits are also rare, with just one pair eight years apart every 105 to 121 years.
"The last Venus transit was in 1882, so no one alive has seen one," said US space agency eclipse expert Fred Espenak.
"Happily, there will be a Venus transit on 8 June, 2004, so this year's Mercury transit can be taken as an appetizer for the main course."
Edmund Halley first realised that transits could be used to measure the Sun's distance, thereby establishing the absolute scale of the Solar System.
Close up: The Swedish 1-m Solar Telescope at La Palma took this image
The 1761 and 1769 expeditions to observe the transits of Venus gave astronomers their first good value for the Sun's distance.
Spacecraft have visited Mercury only once - the US Mariner 10 mission in 1974-75.
Two future missions to Mercury are being planned.
The US Mercury Messenger probe is due for a 2004 launch and 2009 arrival. The European BepiColombo mission will be launched 2011-12 and arrive 2015-16.
UK scientists, students and members of the public gathered at several astronomical centres, including the Royal Observatory Greenwich, to witness the Mercury transit through clear skies.