Although DNA methylation has emerged as an essential epigenetic mechanism modulating organismal responses to abiotic stresses, its involvement in the physiological resilience of marine invertebrates like shrimp to ammonia nitrogen toxicity remains enigmatic. Here, we performed the first comprehensive dissection of genome-wide DNA methylation dynamics in the Pacific whiteleg shrimp Penaeus vannamei exposed to ammonia nitrogen, based on whole-genome bisulfite sequencing and transcriptome analyses. In the genome of P. vannamei, three DNA methyltransferases (DNMT1, DNMT2 and DNMT3a), one DNA demethylase (TET2) and four methyl-CpG binding proteins (MBD2, MBD4, Kaiso, and UHRF1) were present. About 1.68-1.87 % of cytosine nucleotides were methylated, and higher percentages of cytosines in the CpG context (5.23 %-6.34 %) was methylated compared with the CHG and CHH contexts. Methylated cytosines were mostly enriched in the coding DNA sequence, and methylation peaks occurred near the transcription end sites. Following ammonia exposure, 4203 differentially expressed genes (DEGs) and 1100 differentially methylated genes (DMGs) were identified. The DMGs accounted for 4.4 % of the total gene reservoir in P. vannamei genome, and 212 shared genes were found between the DEGs and DMGs. Genes exhibiting significant methylation and expression changes were enriched in various pathways including the FoxO signaling pathway, autophagy and endocytosis. Among them was a group of genes related to energy metabolism, antioxidation response and detoxification metabolism, highlighting involvement of DNA methylation in fine-tuning these crucial physiological processes. These findings provide new insights into the regulatory roles of DNA methylation in the physiological resilience of marine invertebrates to aquatic stressors.