Generalized bent (gbent) functions is a class of functions f : Z n 2 → Z q , where q ≥ 2 is a positive integer, that generalizes a concept of classical bent functions through their codomain extension. A lot of research has recently been devoted towards derivation of the necessary and sufficient conditions when f is represented as a collection of Boolean functions. Nevertheless, apart from the necessary conditions that these component functions are bent when n is even (respectively semi-bent when n is odd), no general construction method has been proposed yet for n odd case. In this article, based on the use of the well-known Maiorana-McFarland (MM) class of functions, we give an explicit construction method of gbent functions, for any even q > 2 when n is even and for any q of the form q = 2 r (for r > 1) when n is odd. Thus, a long-term open problem of providing a general construction method of gbent functions, for odd n, has been solved. The method for odd n employs a large class of disjoint spectra semi-bent functions with certain additional properties which may be useful in other cryptographic applications.