Selective encapsulation of different materials or phases of a material inside a carbon nanotube leads to controlling local properties of the nanotube. We report a method of synthesizing stable γ-Fe selectively inside a carbon nanotube by transforming α-Fe through electron irradiation in situ inside a transmission electron microscope. Therefore, this method enables a single nanotube to encase both high (γ-Fe) and low (α-Fe) temperature phases of iron simultaneously. γ-Fe produced by this method may be used as a novel catalyst, and its presence inside a carbon nanotube may affect the physical properties of the nanotube, which therefore can be used to modify the nanotube.