Hagman first represented his country internationally as a member of the Finnish junior team at the 1998 World Junior Ice Hockey Championships. The tournament was held in Helsinki, and though the Finns were not expected to be contenders, they ultimately won the gold medal. Hagman scored the championship winning goal in overtime to defeat the Russians. He described winning the championship in his home country as being one of the greatest achievements of his career. He again played with the Finnish junior team at the 1999 tournament, but the Finns were unable to duplicate their success, finishing fifth.