The transient temperature field of Al alloy during electron beam welding (EBW) process was simulated using a three-dimensional finite element method. Different from the most previous models which were based on the assumption that the welding pool was solid and neglected the existence of keyhole by meshing the solid as a whole, a dynamic three-dimensional keyhole was applied in this model. The profile of the keyhole was ellipse and its size was determined before simulation based on the results of experiments. Following the heat source, the pre-defined keyhole moved along the welding line. A three-dimensional complex heat source model, including a modified Gaussian distribution source and a uniform source, was used in this study. The result shows that the shape of the keyhole had a direct effect on the temperature distribution and contribution to the special shape of the welding pool in EBW.