Resisting and tolerating microbes are alternative strategies to survive infection, but little is known about the evolutionary mechanisms controlling this balance. Here genomic analyses of anatomically modern humans, extinct Denisovan hominins and mice revealed a TNFAIP3 allelic series with alterations in the encoded immune response inhibitor A20. Each TNFAIP3 allele encoded substitutions at non-catalytic residues of the ubiquitin protease OTU domain that diminished IB kinase-dependent phosphorylation and activation of A20. Two TNFAIP3 alleles encoding A20 proteins with partial phosphorylation deficits seemed to be beneficial by increasing immunity without causing spontaneous inflammatory disease: A20 T108A;I207L, originating in Denisovans and introgressed in modern humans throughout Oceania, and A20 I325N, from an N-ethyl-N-nitrosourea (ENU)-mutagenized mouse strain. By contrast, a rare human TNFAIP3 allele encoding an A20 protein with 95% loss of phosphorylation, C243Y, caused spontaneous inflammatory disease in humans and mice. Analysis of the partial-phosphorylation A20 I325N allele in mice revealed diminished tolerance of bacterial lipopolysaccharide and poxvirus inoculation as tradeoffs for enhanced immunity.