According to History.com, the first official celebration of the Groundhog Day took place on February 2, 1887. This inaugural celebration was the idea of Clymer Freas and took place in Punxsutawney, Pennsylvania.
The celebration itself is based on a tradition that can be dated back to pagan festivals, such as the Imbolc and Candlemas. The event is based on the legend that if a groundhog comes out and sees its shadow on this day, the probability of at least six more weeks of winter is very high. If there is no shadow, the likelihood of an early spring is quite high.