Between 1984 and 2006, 12 959 people with HIV/AIDS (PWHA) in the Swiss HIV Cohort Study contributed a total of 73 412 person-years (py) of follow-up, 35 551 of which derived from PWHA treated with highly active antiretroviral therapy (HAART). Five hundred and ninety-seven incident Kaposi sarcoma (KS) cases were identified of whom 52 were among HAART users. Cox regression was used to estimate hazard ratios (HR) and corresponding 95% confidence intervals (CI). Kaposi sarcoma incidence fell abruptly in 1996-1998 to reach a plateau at 1.4 per 1000 py afterwards. Men having sex with men and birth in Africa or the Middle East were associated with KS in both non-users and users of HAART but the risk pattern by CD4 cell count differed. Only very low CD4 cell count (<50 cells microl(-1)) at enrollment or at HAART initiation were significantly associated with KS among HAART users. The HR for KS declined steeply in the first months after HAART initiation and continued to be low 7-10 years afterwards (HR, 0.06; 95% CI, 0.02-0.17). Thirty-three out of 52 (63.5%) KS cases among HAART users arose among PWHA who had stopped treatment or used HAART for less than 6 months.