Although Hiram Abiff (the architect who built King Solomon's temple 3000 years ago) is often considered as the first freemason, the origins of freemasonry as an organised society is unknown, and subject to many speculations.
According to historical evidences, medieval stonemasons who built great castles and cathedrals had lodges in which they were meeting to initiate new apprentices and discuss trade affairs. The guild was determined to keep the secrets of the craft from public; therefore the initiates had to take oath that they will not reveal their knowledge to outsiders.
In the early 1600s freemasonry started to accept men who had no connection with the trade. As more and more gentlemen begun to join the lodges, they gradually took them over transforming the brotherhood into a society of free and accepted masons, no longer having any connection with stonemasonry.
Nowadays freemasonry is practised worldwide and counts approximately 6 million people.