Recent research suggests that firm-level factors play a significant role in the gender wage gap. This paper adds to this literature by analysing the role of sorting between firms and bargaining within firms using the methodology of Card et al. (2016). We employ linked employer-employee data for the whole population of firms and employees from Estonia for 2006–2017. Estonia is a country with the highest gender wage gap in the EU with about two-thirds of that unexplained by conventional factors. The results show that firm-level factors are important determinants of the gender wage gap, explaining as much as 35% of the gap. We find that within-firm bargaining plays a larger role in the gender wage gap than similar prior papers. This could be related to lenient labour market institutions, as reflected in low minimum wages and union power, and to lower bargaining skills of women. Further, the role of firm-level factors in the gender wage gap have increased over time, and these are especially important at the top of the wage distribution and among workers that are more skilled. There is a heavy penalty for motherhood in wages, 4–9 log points, but this is not related to firm-specific time-invariant productivity premiums.