A technique of using a metal element that has a catalytic action over
crystallization of a semiconductor film to obtain a crystalline
semiconductor film and then effectively removing the metal element
remaining in the film is provided. A first semiconductor film (104)
having a crystal structure is formed on a substrate. A barrier layer
(105) and a second semiconductor film (106) containing a rare gas element
are formed on the first semiconductor film (104). A metal element
contained in the first semiconductor film (104) is moved to the second
semiconductor film (106) through the barrier layer (105) by heat
treatment for gettering.