Asparaginyl endopeptidase (AEP) is an endo/lysosomal cysteine endopeptidase with a preference for an asparagine residue at the P1 site and plays an important role in the maturation of toll-like receptors 3/7/9. AEP is known to undergo autoproteolytic maturation at acidic pH for catalytic activation. Here, we describe crystal structures of the AEP proenzyme and the mature forms of AEP. Structural comparisons between AEP and caspases revealed similarities in the composition of key residues and in the catalytic mechanism. Mutagenesis studies identified N44, R46, H150, E189, C191, S217/S218 and D233 as residues that are essential for the cleavage of the peptide substrate. During maturation, autoproteolytic cleavage of AEP's cap domain opens up access to the active site on the core domain. Unexpectedly, an intermediate autoproteolytic maturation stage was discovered at approximately pH 4.5 in which the partially activated AEP could be reversed back to its proenzyme form. This unique feature was confirmed by the crystal structure of AEPpH4.5 (AEP was matured at pH 4.5 and crystallized at pH 8.5), in which the broken peptide bonds were religated and the structure was transformed back to its proenzyme form. Additionally, the AEP inhibitor cystatin C could be digested by the fully activated AEP, but could not be digested by activated cathepsins. Thus, we demonstrate for the first time that cystatins may regulate the activity of AEP through substrate competition for the active site.