This paper describes the design of a nonaxisymmetric hub contouring in a shroudless axial flow compressor cascade operating at near stall condition. Although an optimum tip clearance (TC) reduces the total pressure loss, further reduction in the loss was achieved using hub contouring. The design methodology presented here combines an evolutionary principle with a three-dimensional (3D) computational fluid dynamics (CFD) flow solver to generate different geometric profiles of the hub systematically. The resulting configurations were preprocessed by GAMBIT© and subsequently analyzed computationally using ANSYSFluent©. The total pressure loss coefficient was used as a single objective function to guide the search process for the optimum hub geometry. The resulting three dimensionally complex hub promises considerable benefits discussed in detail in this paper. A reduction of 15.2% and 16.23% in the total pressure loss and secondary kinetic energy (SKE), respectively, is achieved in the wake region. An improvement of 4.53% in the blade loading is observed. Other complimentary benefits are also listed in the paper. The majority of the benefits are obtained away from the hub region. The contoured hub not only alters the pitchwise static pressure gradient but also acts as a vortex generator in an effort to alleviate the total pressure loss. The results confirm that nonaxisymmetric contouring is an effective method for reducing the losses and thereby improving the performance of the cascade.