An inverted pendulum that is balanced on a cart by a delayed linear feedback force is a model experiment to study delay effects in control problems. Mathematically, the experiment can be described by delay-differential equations (DDEs). The region of stability of the origin (the upside-down position) is bounded for positive delay and shrinks to zero if the delay reaches a critical value. At this critical delay the linearization has a triple-zero eigenvalue. We investigate the neighborhood of this bifurcation to find stable dynamic regimes that correspond to successful balancing, for example stable periodic motions of different types and also chaotic regimes. The main tools for our study are center manifold reduction techniques for DDEs, numerical bifurcation analysis, and computations of invariant manifolds.