In a patient with the acquired immunodeficiency syndrome, a progressive increase in the serum potassium concentration occurred with high-dose trimethoprim-sulfamethoxazole (TMP-SMX) therapy for Pneumocystis carinii pneumonia. In this patient, factors known to alter transcellular potassium shifts to induce hyperkalemia were not present. There was no evidence of glucocorticoid or mineralocorticoid insufficiency at the time of hyperkalemia, while the transtubular potassium gradient decreased. The hyperkalemia resolved spontaneously on discontinuation of TMP-SMX therapy, suggesting that this electrolyte abnormality is related to altered renal tubular secretion of potassium as a consequence of the high-dose TMP-SMX therapy.