From the original laws of the game, 1863 :
"In case the ball goes behind the goal line, if a player on the side to whom the goal belongs first touches the ball, one of his side shall be entitled to a free kick from the goal line at the point opposite the place where the ball shall be touched. If a player of the opposite side first touches the ball, one of his side shall be entitled to a free kick at the goal only from a point 15 yards (14 m) outside the goal line, opposite the place where the ball is touched, the opposing side standing within their goal line until he has had his kick."
I could live with that.