A novel approach for structure alignment is presented, where the key ingredients are: (1) An error function formulation of the problem simultaneously in terms of binary (Potts) assignment variables and real-valued atomic coordinates. (2) Minimization of the error function by an iterative method, where in each iteration a mean field method is employed for the assignment variables and exact rotation/translation of atomic coordinates is performed, weighted with the corresponding assignment variables. The approach allows for extensive search of all possible alignments, including those involving arbitrary permutations. The algorithm is implemented using a C_alpha representation of the backbone and explored on different protein structure categories using the Protein Data Bank (PDB) and is successfully compared with other algorithms. The approach performs very well with modest CPU consumption and is robust with respect to choice of parameters. It is extremely generic and flexible and can handle additional user-prescribed constraints easily. Furthermore, it allows for a probabilistic interpretation of the results.