Background: Recently, some researchers have simulated FSW using FEM and studied the influence of process parameters and tool geometry on material flow, welding force, and temperature and strain distributions during friction stir processing. Additionally, in terms of microstructure modeling, various approaches such as the Cellular Automaton (CA) model have been developed to simulate microstructural evolution during plastic deformation processes. Method: In this work, a finite element model (FEM) is established to study the microstructure evolution during friction stir welding (FSW) of AZ91 magnesium alloy. To this aim, first, the hot compression tests at different temperatures and strain rates were carried out to achieve the flow stress curves. Then, the hardening parameter, the recovery parameter and the strain rate sensitivity were calculated according to flow stress results and using the Kocks−Mecking model. Next, a continuum based thermo-mechanically coupled rigid-viscoplastic FEM model was proposed in Deform-3D software to simulate the FSW of AZ91 magnesium alloy. To evaluate microstructure of the weld zone a model is proposed based on the combination of Cellular Automaton and Laasraoui-Jonas models.