In Malory's Le Morte d'Arthur it's very heavily implied that Merlin enchanted the stone and the sword in it so it only could be pulled out by the true king of Britain/Arthur:
the day came when the Archbishop of Canterbury, on the advice of Merlin, summoned the nobility to London for Christmas morning. In his message the Archbishop promised that the true succession to the British throne would be miraculously revealed.
(pg 5, Keith Baines version, bolding my own)
Then after the church service, all the nobles file out to the courtyard and see the sword/stone with the inscription.
However, nowhere that I can find in Malory does he come right out and say that Merlin enchanted the stone so only Arthur/the true king could pull it out. Do we know Merlin did this for sure?