Cystatins are well known as a vast superfamily of functional proteins participated in the reversible competitive inhibition of cysteine proteases. Currently, increasing evidences point to the extensive phylogenetic diversity and crucial immune roles of type-2 cystatins in the vertebrate species. However, no information is available regarding the homologue in cephalochordate amphioxus, the representative of most basal living chordates, whose immune regulation are still ambiguous. Here, we clearly identified the presence of type-2 cystatin gene in amphioxus Branchiostoma japonicum, termed Bjcystatin-2, which was structurally characterized by typical wedge-shaped cystatin feature. Evolutionary analyses revealed that Bjcystatin-2 is the ancestral type-2 cystatin for chordates, with gene diversity emerging through duplication events. The expression of Bjcystatin-2 showed tissue-specific profile and was inducible upon invasive pathogens. Significantly, the recombinant Bjcystatin-2 exhibited not merely cathepsin L inhibitory activity, but also the ability to bind with bacteria and their characteristic molecules. Furthermore, Bjcystatin-2 also showed the capacity to enhance the macrophage-driven bacterial phagocytosis and to attenuate the generation of pro-inflammatory cytokines within macrophages. In summary, these findings demonstrate that Bjcystatin-2 exhibits dual role acting as both a protease inhibitor and an immunoactive molecule, greatly enriching our understanding of immune defense mechanisms of type-2 cystatin within the amphioxus.