Sequence comparison remains a powerful tool to assess the structural relatedness of two proteins. To improve reliability of recognition in the twilight zone of sequence identities between 15 and 35%, we performed an exhaustive alignment of sequences of protein domains with known 3D folds and derived a set of functions which represent structural significance and positional accuracy of any sequence alignment. The subset of 1,347,037 alignments between sequences of structurally unrelated domains was used to derived accurate probability functions of a structurally insignificant alignment at a given sequence identity, sequence similarity and alignment score. It is shown that sequence identity and sequence similarity measures are poor indicators of structural relatedness in the twilight zone, while the alignment score allows much better discrimination between alignments of structurally related sequences and unrelated ones, with the expected recognition error being three times lower. The derived functions can be used for fold recognition.