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 less than or equal to t less than or equal to 0.2 root Re) and intermediate (0.2 root Re less than or equal to t less than or equal to 3 root Re) stages of decaying 2D turbulence (t congruent to 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 greater than or equal to 3 root Re: 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 Omega over energy E, and the extremum of vorticity (normalized by root E) have been computed based on ensemble averaging of the no-slip runs. An algebraic regime has been observed with V(t)similar to t(-0.90), a(t) similar to t(0.31), Omega(t)/E(t)similar to t(- 0.63), and omega(ext)(t)/ root E(t)similar to 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. (C) 1999 American Institute of Physics. [S1070-6631(99)01403-8].