The dynamics of the pairwise entanglement in a qubit lattice in the presence of static imperfections exhibits different regimes. We show that there is a transition from a perturbative region, where the entanglement is stable against imperfections, to the ergodic regime, in which a pair of qubits becomes entangled with the rest of the lattice and the pairwise entanglement drops to zero. The transition is almost independent of the size of the quantum computer. We consider both the case of an initial maximally entangled and separable state. In this last case there is a broad crossover region in which the computer imperfections can be used to create a significant amount of pairwise entanglement.PACS numbers: 03.67. Lx, 03.67.Mn, 24.10.Cn Any practical implementation of a quantum computer will have to face errors, due to the inevitable coupling to the environment [1,2] or to device imperfections [3]. The effect of the environment is to introduce decoherence which sets the time scale over which quantum computation is no longer possible. The presence of static imperfections, although not leading to any decoherence, may be also decremental for the implementation of any quantum computational task. A small inaccuracy in the coupling constants induces errors in gating or an unwanted time evolution in the case in which the Hamiltonian cannot be switched exactly to zero. If the imperfection strength increases, new phenomena occur and above a certain threshold the core of the computer can even "melt" due to the setting in of chaotic behavior [3]. Previous investigations of the stability of quantum information processing in the presence of such effects mainly studied the fidelity of the quantum evolution as an indicator of the quality of the computation [3,4,5]. In particular, in Ref.[3] the fidelity was used to measure the stability of the quantum memory, that is of a state loaded on a quantum computer with imperfections. A more complete characterization of the stability of a quantum computation requires a deeper investigation of the state of the system. Fidelity is one of the ways to characterize it. In this Letter we discuss the behavior of entanglement on approaching the transition to quantum chaos. Entanglement is not only one of the most intriguing features predicted by the quantum theory but also a fundamental resource for quantum computation and communication [6]. Therefore studies of the stability of entanglement under decoherence and imperfection effects are, in our opinion, of interest.We model the quantum computer as a lattice of interacting spins (qubits) where, due to the unavoidable presence of imperfections, the spacing between the up and down states (external field) and the couplings between the qubits (exchange interactions) are both random. The entanglement properties in spin systems has recently attracted attention and we refer to [7] for a more detailed introduction. In this work we consider, for the first time, the effect of disorder in the couplings.We consider n qubits on a two-dimensional lattice, d...