Matrine is an alkaloid from Sophora flavescens that exhibits multiple protective effects on cancers. However, the molecular mechanisms of anti-metastatic effects of matrine on castration-resistant prostate cancer (CRPC) remain unknown. This study investigated the anti-metastatic effects of matrine on CRPC to identify the underlying mechanisms. The effects of matrine on the cell viability of DU145 and PC-3 cells were measured using MTS assay. The impact of matrine on expression levels of matrix metalloproteinase (MMP)-9, MMP-2, nuclear factor-κB (NF-κB) subunit p65 and phosphorylated p65 in cells untreated or treated with matrine were analyzed by western blotting. The inhibitory effects of matrine on cell migration and invasion were examined by Transwell assay. The impact of matrine on tumorigenesis in male Balb/c nude mice inoculated subcutaneously with cells were investigated in vivo. We found that matrine inhibited the growth of DU145 and PC3 cells time- and dose-dependently both in vitro and in vivo. Migration and invasion capabilities of cells were also suppressed by matrine. At the same time, matrine markedly reduced the expression levels of MMP-9, MMP-2 and p-p65 in both cell lines. Further experiments revealed that matrine exhibited inhibitory effects of migration and invasion of CRPC by downregulating MMP-2/9 through NF-κB pathway. Matrine inhibits invasion of CRPC by reducing levels of MMP-9 and MMP-2 through NF-κB pathway. Therefore, it may be a potential anti-metastatic therapeutic agent for CRPC.