The convection induced by buoyancy effects in a porous square cavity has been investigated numerically using a spectral element code with bifurcation tools. The complex bifurcation diagram initiated from the first six primary bifurcation points corresponding to the onset of convection from the trivial no-flow solution has been calculated. Four branches of stable steady solutions have been found, corresponding to one-roll, two-roll, three-roll and four-roll flow structures. The domain of existence of these stable solutions, i.e., the Rayleigh number (Ra) range in which such solutions can potentially be observed, has been precisely determined. It is shown that there exist Ra ranges where different flow solutions can be stable together. The stable branches all terminate at Hopf bifurcation points beyond which oscillatory solutions have been computed.