This paper analyses the factors which determine whether an individual works in the formal sector, in the informal sector, or remains unemployed in the Spanish labour market. We highlight the implications of high unemployment on an individual's decision to work in the underground economy. We postulate that an individual decides (or is chosen) whether to work in the formal sector or not in a first stage and, if not, in a second stage decides whether to work in the underground sector or to remain unemployed. We estimate a bivariate probit model which controls for selectivity bias in the second stage. The result indicates on the one hand, that heads of household, who benefit more from social security provisions obtained in formal sector jobs, are more likely to work in such sector than others. Besides, demand restrictions seem to operate as well-individuals with higher education have easier access to the formal sector. On the other hand, among those who do not work in the formal sector, the probability of working in the informal sector relative to being unemployed is higher among those whose head of household works. For females, the probability of staying unemployed (relative to working in the informal sector) increases with education, suggesting that highly educated women prefer to search for a formal sector job rather than to work in the underground economy. We also examine the job search behaviour among the informal sector workers.