Golden pompano, Trachinotus ovatus, as a highly nutritious commercially valuable marine fish, has become one of the preferred species for many fish farmers due to its rapid growth, wide adaptability, and ease of feeding and management. However, with the expansion of aquaculture scale, bacterial and parasitic diseases have also become major threats to the golden pompano industry. This study, based on comparative genomics, shows the possibility of preferential evolution of freshwater fish over marine fish by analyzing the phylogenetic relationships and divergence times of 14 marine fish and freshwater fish. Furthermore, we identified antimicrobial peptide genes from 14 species at the genomic level and found that the number of putative antimicrobial peptides may be related to species evolution. Subsequently, we classified the 341 identified AMPs from golden pompano into 38 categories based on the classification provided by the APD3. Among them, TCP represented the highest proportion, accounting for 23.2% of the total, followed by scolopendin, lectin, chemokine, BPTI, and histone-derived peptides. At the same time, the distribution of AMPs in chromosomes varied with type, and covariance analysis showed the frequency of its repeat events. Enrichment analysis and PPI indicated that AMP was mainly concentrated in pathways associated with disease immunity. In addition, our transcriptomic data measured the expression of putative AMPs of golden pompano in 12 normal tissues, as well as in the liver, spleen, and kidney infected with Streptococcus agalactiae and skin infected with Cryptocaryon irritans. As the infection with S. agalactiae and C. irritans progressed, we observed tissue specificity in the number and types of responsive AMPs. Positive selection of AMP genes may participate in the immune response through the MAPK signaling pathway. The genome-wide identification of antimicrobial peptides in the golden pompano provided a complete database of potential AMPs that can contribute to further understanding the immune mechanisms in pathogens. AMPs were expected to replace traditional antibiotics and be developed into targeted drugs against specific bacterial and parasitic pathogens for more precise and effective treatment to improve aquaculture production.