In endemic regions (West Africa and the Congo Basin), the genetic diversity of monkeypox virus (MPXV) is geographically structured into two major clades (clade I and II) that differ in virulence and host associations. Clade IIb is closely related to the B.1 lineage, which is dominating a worldwide outbreak initiated in 2022. Lineage B.1 has however accumulated mutations of unknown significance that most likely result from APOBEC3 (apolipoprotein B mRNA editing catalytic polypeptide-like 3) editing. We applied a population genetics-phylogenetics approach to investigate the evolution of MPXV during historical viral spread in Africa and to infer the distribution of fitness effects. We observed a high preponderance of codons evolving under strong purifying selection, particularly in viral genes involved in morphogenesis and replication or transcription. However, signals of positive selection were also detected and were enriched in genes involved in immunomodulation and/or virulence. In particular, several genes showing evidence of positive selection were found to hijack different steps of the cellular pathway that senses cytosolic DNA. Also, a few selected sites in genes that are not directly involved in immunomodulation are suggestive of antibody escape or other immuno-mediated pressures. Because orthopoxvirus host range is primarily determined by the interaction with the host immune system, we suggest that the positive selection signals represent signatures of host adaptation and contribute to the different virulence of clade I and II MPXV. We also used the calculated selection coefficients to infer the effects of mutations that define the predominant hMPXV1 lineage B.1, as well as the changes that have been accumulating during the worldwide outbreak. Results indicated that a proportion of deleterious mutations were purged from the predominant outbreak lineage, whose spread was not driven by the presence of beneficial changes. Polymorphic mutations with a predicted beneficial effect on fitness are few and have a low frequency. It remains to be determined whether they have any significance for ongoing virus evolution.