Loss of CD40 ligand (CD40L) expression or function results in X-linked hyper-immunoglobulin (Ig)M syndrome (X-HIGM), characterized by recurrent infections due to impaired immunoglobulin class-switching and somatic hypermutation. Previous attempts using retroviral gene transfer to correct murine CD40L expression restored immune function; however, treated mice developed lymphoproliferative disease, likely due to viral-promoter-dependent constitutive CD40L expression. These observations highlight the importance of preserving endogenous gene regulation in order to safely correct this disorder. Here, we report efficient, on-target, homology-directed repair (HDR) editing of the CD40LG locus in primary human T cells using a combination of a transcription activator-like effector nuclease-induced double-strand break and a donor template delivered by recombinant adeno-associated virus. HDR-mediated insertion of a coding sequence (green fluorescent protein or CD40L) upstream of the translation start site within exon 1 allowed transgene expression to be regulated by endogenous CD40LG promoter/enhancer elements. Additionally, inclusion of the CD40LG 3'-untranslated region in the transgene preserved posttranscriptional regulation. Expression kinetics of the transgene paralleled that of endogenous CD40L in unedited T cells, both at rest and in response to T-cell stimulation. The use of this method to edit X-HIGM patient T cells restored normal expression of CD40L and CD40-murine IgG Fc fusion protein (CD40-muIg) binding, and rescued IgG class switching of naive B cells in vitro. These results demonstrate the feasibility of engineered nuclease-directed gene repair to restore endogenously regulated CD40L, and the potential for its use in T-cell therapy for X-HIGM syndrome.