With the explosive growth of bacterial and archaeal sequence data, large-scale phylogenetic analyses present both opportunities and challenges. Here we describe AMPHORA2, an automated phylogenomic inference tool that can be used for high-throughput, high-quality genome tree reconstruction and metagenomic phylotyping. Compared with its predecessor, AMPHORA2 has several major enhancements and new functions: it has a greatly expanded phylogenetic marker database and can analyze both bacterial and archaeal sequences, it incorporates probability-based sequence alignment masks that improve the phylogenetic accuracy, it can analyze DNA as well as protein sequences and is more sensitive in marker identification, finally, it is over 100× faster in metagenomic phylotyping.