With the aim of establishing, under wide conditions, the ergodic theorem of G. D. Birkhoff, the author extends the class of asymptotically almost-periodic functions, considering now not only continuous functions, as he had already done in 1943, but discontinuous functions. Definitions and properties of the extended class of functions are set out, some comparisons being made with almost-periodic functions in the sense of Bohr, Stepanoff, Weyl and Besicovitch. Applications to the ergodic theorem are adumbrated.