Antimicrobial resistance (AMR) is one of the most urgent threats to the global public health, and the expanding use of antimicrobials in food animals is considered as a main reason for the worldwide rapid increasing of AMR. However, AMR in animals in many regions are poorly documented. China is the largest pig-rearing and pork consumption country in the world. In the present study, we identified AMR in pig farms from all provinces (including Tibet and Qinghai) of mainland China by investigation of a common indicator bacterium Escherichia coli from both pigs and the breeding environmental samples. A total of 2693 samples from pigs and environments in 67 pig farms in all 31 provinces of mainland China were collected between 1 October 2018 to 30 September 2019, and a total of 1871 E. coli strains were isolated. By testing the susceptibility of these 1871 E. coli isolates on 28 types of antibiotics that commonly used in both human and veterinary medicine, we found that resistance to tetracycline (96.26%), chloramphenicol (82.04%), moxifloxacin (81.56%), and trimethoprim/sulfamethoxazole (80.38%) were the broad phenotypes among these E. coli isolates from pig farms in China. A proportion of E. coli isolates were resistant to colistin (3.79%), carbapenems (imipenem [2.62%], meropenem [2.30%], ertapenem [2.46%]), and broad-spectrum-cephalosporins (ceftriaxone [29.56%], cefepime [14.00%]). More than 70% of the isolates displayed multidrug-resistant (MDR), and/or extensively drug-resistant (XDR) phenotypes, and MDR/XDR-E. coli was observed in pig farms in all provinces of mainland China. We also systematically revealed the distribution of O-serogroups, sequence types, resistance genes, virulence factors encoding genes, and putative plasmids of MDR/XDR-E. coli in pig farms from different provinces of China, and partially characterized the pathotypes of certain MDR/XDR-E. coli strains. In addition, the genetic transmission basis of the blaNDM, mcr, ESBL-encoding, fluoroquinolone-resistance, and tetX genes were addressed in this study. Most importantly, we suggested a very high genetic propensity of the pig farm-sourced MDR/XDR-E. coli in spreading into humans. To the best of our knowledge, this is the first study on a national scale that the resistance phenotypes and population genomics of E. coli in pig farms in China are revealed. Our data presented herein will help understand the current profile of AMR in pigs and also provide reference for policy formulation of AMR control action in livestock in China.