A laser welding experiment with glass is conducted to directly observe the keyhole behavior and spatter formation in fiber laser welding of aluminum alloy. A 3D model is developed to investigate the spatter formation and composition change. An additional conservation equation is introduced to describe the Mg element distribution, and the Mg element loss due to evaporation is also considered. Based on numerical and experimental results, it is found that the keyhole geometry in laser welding of aluminum alloy is different from that in laser welding of steel. There are three required steps for spatter formation around the keyhole. The high momentum of the molten metal, the high recoil pressure and vapor shear stress, and the low surface tension around the keyhole contribute to the easy formation of spatter. The in-homogeneous distribution of Mg element in the weld can be attributable to the continuous evaporation of Mg element at the top surface of keyhole rear, the upward flow of low Mg element region from the bottom of the keyhole to the top surface of keyhole rear along the fusion line, the collapse of the keyhole, and the ejection of spatters.