Ligand field theory (LFT) is one of the cornerstones of coordination chemistry since it provides a conceptual framework in which a great many properties of d- and f-element compounds can be discussed. While LFT serves as a powerful qualitative guide, it is not a tool for quantitative predictions on individual compounds since it incorporates semiempirical parameters that must be fitted to experiment. One way to connect the realms of first-principles electronic structure theory that has emerged as particularly powerful over the past decade is the ab initio ligand field theory (AILFT). The original formulation of this method involved the extraction of LFT parameters by fitting the ligand field Hamiltonian to a complete active space self-consistent field (CASSCF) Hamiltonian. The extraction was shown to be unique provided that the active space consists of 5/7 metal d/f-based molecular orbitals (MOs). Subsequent improvements have involved incorporating dynamical correlation using second-order N-electron valence state perturbation theory (NEVPT2) or second-order dynamical correlation dressed complete active space (DCDCAS). However, the limitation of past approaches is that the method requires a minimal space of 5/7 metal d- or f-based molecular orbitals. This leads to a number of limitations: (1) neglect of radial or semicore correlation would arise from the effect of a second d-shell or an sp-shell in the active space, (2) a more balanced description of metal-ligand bond covalency is lacking because the bonding ligand-based counterparts of the metal d/f orbitals are not in the active space. This usually leads to an exaggerated ionicity of the M-L bonds. In this work, we present an extended active space AILFT (esAILFT) that circumvents these limitations and is, in principle, applicable to arbitrary active spaces, as long as these contain the 5/7 metal d/f-based MOs as a subset. esAILFT was implemented in a development version of the ORCA software package. In order to help with the application of the new method, various criteria for active space extension were explored for 3d, 4d, and 5d transition-metal ions with varying charge. An interpretation of the trends in the Racah B parameter for these ions is also presented as a demonstration of the capabilities of esAILFT.