In recent years, several countries have enacted guidelines and/or mandatory laws to increase the presence of women on the boards of companies. Through these regulatory interventions, the aim is to eradicate the social and labor grievances that women have traditionally experienced and which has relegated them to smaller-scale jobs. Nevertheless, and despite the advances achieved, the female representation in the boardroom remains far from the desired levels. In this context, it is now necessary to enhance the advantages of board gender diversity from both ethical and economic points of view. This article examines the relation between board gender diversity and economic results in Spain: the second country in the world to legally require gender quotas in boardrooms and historically characterized by a minimal female participation in the workforce. Based on a sample of 125 non-financial firms listed on the Madrid Stock Exchange from 2005 to 2009, our findings show that in the period analyzed the increase of the number of women on boards was over 98 %. This suggests that compulsory legislation offers an efficient framework to execute the recommendation of Spanish codes of good governance by means of the increase in the number of women in the boards of firms. Furthermore, we find that the increase in the number of women on the boards is positively related to higher economic results. Therefore, both results suggest that gender diversity in boardrooms should be incremented, mandatory laws being a key factor to do so.