Bile duct ligation (BDL) in young rats can cause impaired liver function and cognition deficits. Nitric oxide is implicated in hepatic encephalopathy and is also involved in cognition. In this study, we examined the role of brain asymmetric dimethylarginine (ADMA), an endogenous nitric oxide synthase inhibitor, in young BDL rats with spatial deficits. Young male Sprague-Dawley rats aged 17 days were assigned to four groups: laparotomy (SHAM), laparotomy plus 5 mg melatonin delivered through a pellet (SHAMM) for 4 weeks, BDL for 4 weeks, and BDL plus 5 mg melatonin delivered through a pellet (BDLM) for 4 weeks. Their spatial memory was assessed using a Morris water-maze task. Plasma and brains were collected for biochemical and ADMA analyses. We found that the BDL group had significantly elevated levels of ADMA in the plasma, the prefrontal cortex, and the dorsal hippocampus, and worse spatial performance than that of the control groups. Melatonin administration prevented an increase in the ADMA levels in the plasma, prefrontal cortex, and dorsal hippocampus, and prevented spatial deficits in BDL rats. In addition, melatonin maintained brain-derived neurotrophic factor in the dorsal hippocampus at a level comparable with controls. We concluded that melatonin is effective in preventing spatial deficits and decreasing ADMA levels in the plasma, prefrontal cortex, and dorsal hippocampus in young BDL rats. Brain ADMA levels might play a role in BDL-induced spatial deficits.