Engineered T cells are effective therapies against a range of malignancies, but current approaches rely on autologous T cells, which are difficult and expensive to manufacture. Efforts to develop potent allogeneic T cells that are not rejected by the recipient's immune system require abrogating both T- and natural killer (NK)-cell responses, which eliminate foreign cells through various mechanisms. In the present study, we engineered a receptor that mediates deletion of activated host T and NK cells, preventing rejection of allogeneic T cells. Our alloimmune defense receptor (ADR) selectively recognizes 4-1BB, a cell surface receptor temporarily upregulated by activated lymphocytes. ADR-expressing T cells resist cellular rejection by targeting alloreactive lymphocytes in vitro and in vivo, while sparing resting lymphocytes. Cells co-expressing chimeric antigen receptors and ADRs persisted in mice and produced sustained tumor eradication in two mouse models of allogeneic T-cell therapy of hematopoietic and solid cancers. This approach enables generation of rejection-resistant, 'off-the-shelf', allogeneic T-cell products to produce long-term therapeutic benefit in immunocompetent recipients.