Merlin (Welsh: Myrddin, Cornish: Merdhyn, Breton: Merzhin) is a mythical figure prominently featured in the legend of King Arthur and best known as a magician, with several other main roles. The familiar depiction of Merlin, based on an amalgamation of historical and legendary figures, was introduced by the 12th-century British pseudo-historical author Geoffrey of Monmouth and then built on by the French poet Robert de Boron and prose successors in the 13th century.
Geoffrey seems to have combined earlier Welsh tales of Myrddin and Ambrosius, two legendary Briton prophets with no connection to Arthur, to form the composite figure that he called Merlinus Ambrosius. His rendering of the character became immediately popular, especially in Wales. Later chronicle and romance writers in France and elsewhere expanded the account to produce a more full, multifaceted character, creating one of the most important figures in the imagination and literature of the Middle Ages.
Merlin's traditional biography casts him as an often-mad cambion, born of a mortal woman and an incubus, from whom he inherits his supernatural powers and abilities. His most notable abilities commonly include prophecy and shapeshifting. Merlin matures to an ascendant sagehood and engineers the birth of Arthur through magic and intrigue. Later stories have Merlin as an advisor and mentor to the young king until he disappears from the tale, leaving behind a series of prophecies foretelling events to come. A popular version from the French prose cycles tells of Merlin being bewitched and forever sealed up or killed by his student, the Lady of the Lake after he fell in love with her. Other texts variously describe his retirement, at times supernatural, or death.
Source : Wikipedia