Studies of magnetic field exposure and cancer have focused on either residential or occupational exposure. We conducted a case-control study taking into account both exposure sources. We identified leukemia and central nervous system tumor cases and controls from a population living within 300 m of transmission lines in Sweden. We have previously reported results considering residential exposure alone. Here, we evaluate the effect of occupational exposure and of the combined exposures. We estimated residential exposure through calculations of the magnetic fields generated by power lines. We obtained information about occupation from censuses and linked the occupations to a job-exposure matrix based on magnetic field measurements. For occupational exposure of > or = 0.2 microT, we estimated the relative risk for leukemia to be 1.7 [95% confidence interval (CI) = 1.1-2.7]. The increased risk was confined to acute myeloid and chronic lymphocytic leukemia. For residential exposure of > or = 0.2 microT, the relative risk for leukemia was estimated at 1.3 (95% CI = 0.8-2.2), with higher risk estimates for acute and chronic myeloid leukemia. We estimated the relative risk for leukemia among subjects highly exposed both at home and at work to be 3.7 (95% CI = 1.5-9.4). These results provide support for an association between magnetic field exposure and leukemia. Relative risks for nervous system tumors were close to unity.