Japanese encephalitis (JE) has been found to be endemic in Bali, Indonesia. A case-control study was conducted to identify factors associated with JE infection. All 94 serologically confirmed JE cases (cases) and 163 cases of encephalitis or aseptic meningitis without JE (controls) identified in Bali during 2001–2004 were included in the study. Potential risk factors were surveyed at hospital admission. Univariate analyses revealed the following factors to be associated with JE: older age, referral from sub-district health centre or private hospital, playing outdoors after dinner, use of mosquito repellent or spraying, proximity of the residence to rice fields, and pig ownership by the family or next-door neighbours. Multivariate analysis identified proximity to rice fields (OR 2·93, 95% CI 1·57–5·45), pig ownership (OR 2·24, 95% CI 1·17–4·26), and older age (OR 1·21, 95% CI 1·09–1·33) as being independently associated with the risk of JE. Because rice cultivation and pig rearing are essential to the economy of Bali, JE immunization is the best intervention for prevention of JE in Bali.