The selective generation of covalent bonds between and within proteins would provide new avenues for studying protein function and engineering proteins with new properties. New covalent bonds were genetically introduced into proteins by enabling an unnatural amino acid (Uaa) to selectively react with a proximal natural residue. This proximity-enabled bioreactivity was expanded to a series of haloalkane Uaas. Orthogonal tRNA/synthetase pairs were evolved to incorporate these Uaas, which only form a covalent thioether bond with cysteine when positioned in close proximity. By using the Uaa and cysteine, spontaneous covalent bond formation was demonstrated between an affibody and its substrate Z protein, thereby leading to irreversible binding, and within the affibody to increase its thermostability. This strategy of proximity-enabled protein crosslinking (PEPC) may be generally expanded to target different natural amino acids, thus providing diversity and flexibility in covalent bond formation for protein research and protein engineering.