We study the restricted category 𝒪 for an affine Kac–Moody algebra at the critical level. In particular, we prove the first part of the Feigin–Frenkel conjecture: the linkage principle for restricted Verma modules. Moreover, we prove a version of the Bernstein–Gelfand–Gelfand-reciprocity principle and we determine the block decomposition of the restricted category 𝒪. For the proofs, we need a deformed version of the classical structures, so we mostly work in a relative setting.