We report results of direct numerical simulations of decaying two-dimensional (2D) turbulence inside a square container with rigid boundaries. It is shown that the type of boundary condition (no-slip or stress-free) determines the flow evolution essentially. During the initial (0 ¿ t ¿ 0.2) and intermediate (0.2 ¿ t ¿ 3) stages of decaying 2D turbulence (t ¿ 1 is comparable with an eddy turnover time, Re is the Reynolds number of the flow), the decay scenario for simulations with no-slip boundary conditions can be understood from turbulent spectral transfer and selective decay. A third mechanism can be recognized for t = 3: A decay stage where diffusion dominates over nonlinear advection, i.e., spectral transfer is then absent in favor of self-similar decay. The present results show that at presently accessible Reynolds numbers and computation times, laboratory experiments cannot be accurately compared with quasi-stationary states from ideal maximum-entropy theories or with computed solutions of flows in containers with stress-free boundaries. The decay which results in rectangular containers with no-slip boundaries does not yet yield anything that is meaningfully comparable with these formulations. The evolution of the number of vortices V, the average vortex radius a, the ratio of enstrophy O over energy E, and the extremum of vorticity (normalized by ) have been computed based on ensemble averaging of the no-slip runs. An algebraic regime has been observed with V(t) ~ t-0.90, a(t) ~ t0.31, O(t)/E(t) ~ t-0.63, and ¿ext(t)/ ~ t-0.30. Finally, quantities such as a measure of the viscous stresses near the boundaries have been computed in order to analyze the decay of 2D turbulence in containers with rigid boundaries.