Excalibur's story is often mixed up with that of the Sword in the Stone, which King Arthur pulls from a rock, but it isn't, there were two swords. Excalibur was given to Arthur by the Lady in the Lake toward the end of his life, and as Arthur's story ends it is thrown back to where it came, a hand rising from the lake to catch it and then it disappears. The drawing of the sword from the stone takes place before Arthur is king and is not, I don't think, ever mentioned again. It is in earlier versions of Thomas Malory's story La Morte D'Arthur, written in the late fifteen century, that both swords are merged into one and called Excalibur and this is the reason we think of only one sword today.
So where does the story of the Sword in the Stone originate? My blog of last year explains.