Homeobox genes function as master regulatory transcription factors during embryogenesis. HOXB5 is known to play an important role in several cancers. However, the biological role of HOXB5 in prostate cancer (PCa) is not fully elucidated. This study aimed to analyze the expression and function of HOXB5 and involvement of HOXB5 in neuroendocrine differentiation in PCa. Immunohistochemistry showed that 56 (43.8%) of 128 cases of localized PCa were positive for HOXB5. HOXB5-positive cases were associated with poor prostate-specific antigen recurrence-free survival after prostatectomy. Among 74 cases of metastatic PCa, 43 (58.1%) were positive for HOXB5. HOXB5 expression was higher in metastatic PCa than that in localized PCa. HOXB5 knockdown suppressed cell growth and invasion, but HOXB5 overexpression increased cell growth and invasion in PCa cell lines. Furthermore, HOXB5 regulated RET expression. Gene set enrichment analysis revealed that Nelson androgen response gene set was enriched in low HOXB5 expression group. RB1 knockout increased HOXB5 expression. Of note, additional p53 knockdown further increased HOXB5 expression in RB1 knockout cells. In silico analysis showed that HOXB5 expression was increased in neuroendocrine PCa (NEPC). These results suggest that HOXB5 may be a promising prognostic marker after prostatectomy and is involved in progression to NEPC.