The function of TRIM5 (tripartite motif containing 5, ENSG00000132256) is as follows. Capsid-specific restriction factor that prevents infection from non-host-adapted retroviruses. Blocks viral replication early in the life cycle, after viral entry but before reverse transcription. In addition to acting as a capsid-specific restriction factor, also acts as a pattern recognition receptor that activates innate immune signaling in response to the retroviral capsid lattice. Binding to the viral capsid triggers its E3 ubiquitin ligase activity, and in concert with the heterodimeric ubiquitin conjugating enzyme complex UBE2V1- UBE2N (also known as UBC13-UEV1A complex) generates 'Lys-63'-linked polyubiquitin chains, which in turn are catalysts in the autophosphorylation of the MAP3K7/TAK1 complex (includes TAK1, TAB2, and TAB3). Activation of the MAP3K7/TAK1 complex by autophosphorylation results in the induction and expression of NF-kappa-B and MAPK- responsive inflammatory genes, thereby leading to an innate immune response in the infected cell. Restricts infection by N-tropic murine leukemia virus (N-MLV), equine infectious anemia virus (EIAV), simian immunodeficiency virus of macaques (SIVmac), feline immunodeficiency virus (FIV), and bovine immunodeficiency virus (BIV) (PubMed:17156811). Plays a role in regulating autophagy through activation of autophagy regulator BECN1 by causing its dissociation from its inhibitors BCL2 and TAB2 (PubMed:25127057). Also plays a role in autophagy by acting as a selective autophagy receptor which recognizes and targets HIV-1 capsid protein p24 for autophagic destruction (PubMed:25127057). {ECO:0000269|PubMed:12878161, ECO:0000269|PubMed:17156811, ECO:0000269|PubMed:18312418, ECO:0000269|PubMed:21035162, ECO:0000269|PubMed:21512573, ECO:0000269|PubMed:21632761, ECO:0000269|PubMed:22291694, ECO:0000269|PubMed:25127057}.