In the opening scene of the play, Horatio, Marcellus, and Bernardo witness a ghost roam the outer walls of Elsinore Castle near midnight while they are standing guard. All three men are astonished by the ghost's resemblance to the deceased King Hamlet, and Horatio attempts to speak to the ghost in vain. At the end of the scene, Horatio mentions that it is his duty to inform Prince Hamlet about the mysterious ghost roaming the outer walls of Elsinore Castle.
In act 1, scene 4, Horatio and Marcellus have informed Prince Hamlet about the ghost, and he visits the castle's battlements with them around midnight to witness the spectacle. The ghost arrives, and Prince Hamlet is astonished by its resemblance to his recently deceased father. Prince Hamlet is initially perplexed by the nature of the ghost and wonders if it is a divine spirit sent from heaven or a malevolent agent of the devil. Suddenly, the ghost beckons Hamlet to follow it, and Horatio and Marcellus attempt to dissuade him from obeying the ghost's orders. Hamlet mentions that he has nothing to fear or lose and decides to follow the ghost. In the next scene, Hamlet speaks to the ghost and discovers that Claudius assassinated his father.