Subradiant states - as a special kind of entangled states of several two-le
vel atoms - have recently gained wide attention because these states are ex
ceptional in the sense that they dissipate energy much slower then other co
llective states. This property implies also that their decoherence is slow,
and henceforth they are promising candidates for registers of a quantum co
mputer. Here we propose a scheme which can be used to prepare subradiant st
ates in a cavity. We present perturbative and also exact results showing th
at after a certain time the evolution of a multiatomic system in a detuned
cavity leads to an appropriate entangled state. At this time instant it is
sufficient to apply subsequent laser pulses on a control atom in order prep
are a state in the subradiant, i.e., a decoherence free subspace.