Previous work has established a role for CD40-mediated signals in eliciting helper-dependent CD8(+) T cell responses. Here we investigated the effects of in vivo CD40 stimulation on the survival and function of tumor-specific CD8(+) T cells in a mouse melanoma model system. We found that agonistic anti-CD40 antibody treatment alone of tumor-bearing mice accelerated the deletion of tumor-antigen-specific T cells. However, long-term survival and function of tumor-antigen-specific T cells could be achieved when viral immunization with tumor antigen and anti-CD40 treatment were combined. This rescue of CD8(+) T cells could not be easily replicated by inflammatory or antigen-specific stimuli alone, demonstrating the specificity of signals that regulate the deletion or survival of tumor-specific T cells. These results demonstrate that opposing effects can be elicited by CD40 stimulation in vivo and suggest the need for caution in using this treatment for cancer patients.