Weather has a significant impact on different sectors of the economy. One of the most sensitive is the electricity market, because power demand is linked to several weather variables, mainly the air temperature. This work analyzes the relationship between electricity load and daily air temperature in Spain, using a population-weighted temperature index. The electricity demand shows a significant trend due to socioeconomic factors, in addition to daily and monthly seasonal effects that have been taken into account to isolate the weather influence on electricity load. The results indicate that the relationship is nonlinear, showing a `comfort interval' of ±3°C around 18°C and two saturation points beyond which the electricity load no longer increases. The analysis has also revealed that the sensitivity of electricity load to daily air temperature has increased along time, in a higher degree for summer than for winter, although the sensitivity in the cold season is always more significant than in the warm season. Two different temperature-derived variables that allow a better characterization of the observed relationship have been used: the heating and cooling degree-days. The regression of electricity data on them defines the heating and cooling demand functions, which show correlation coefficients of 0.79 and 0.87, and predicts electricity load with standard errors of estimate of ±4% and ±2%, respectively. The maximum elasticity of electricity demand is observed at 7 cooling degree-days and 9 heating degree-days, and the saturation points are reached at 11 cooling degree-days and 13 heating degree-days, respectively. These results are helpful in modeling electricity load behavior for predictive purposes.