A hierarchical optimisation strategy has been introduced for minimising the Hartree-Fock/Kohn-Sham energy, consisting of three levels (3L): an atom-in-a-molecule optimisation, a valence-basis molecular optimisation, and a full-basis molecular optimisation. The density matrix formed at one level is used as a starting density matrix at the next level with no loss of information. To ensure a fast and reliable convergence to a minimum, the augmented Roothaan-Hall (ARH) algorithm is used in both the valence-basis and full-basis molecular optimisations. The performance of the ARH-3L method is compared with standard optimisation algorithms. Both for efficiency and reliability, we recommend to use the ARH-3L algorithm.