While T-cell responses are directly modulated by Toll-like receptor (TLR) ligands, the mechanism and physiological function of nucleic acids (NAs)-mediated T cell costimulation remains unclear. Here we show that unlike in innate cells, T-cell costimulation is induced even by non-CpG DNA and by self-DNA, which is released from dead cells and complexes with antimicrobial peptides or histones. Such NA complexes are internalized by T cells and induce costimulatory responses independently of known NA sensors, including TLRs, RIG-I-like receptors (RLRs), inflammasomes and STING-dependent cytosolic DNA sensors. Such NA-mediated costimulation crucially induces Th2 differentiation by suppressing T-bet expression, followed by the induction of GATA-3 and Th2 cytokines. These findings unveil the function of NA sensing by T cells to trigger and amplify allergic inflammation.