Ship rat (Rattus rattus) density was assessed by snap-trapping during summer and autumn in eight indigenous forest fragments (mean 5 ha) in rural landscapes of Waikato, a lowland pastoral farming district of the North Island, New Zealand. Four of the eight were fenced and four grazed. In each set of four, half were connected with hedgerows, gullies or some other vegetative corridor to nearby forest and half were completely isolated. Summer rat density based on the number trapped in the first six nights was higher in fenced (mean 6.5 rats ha–1) than in grazed fragments (mean 0.5 rats ha–1; P = 0.02). Rats were eradicated (no rats caught and no rat footprints recorded for three consecutive nights) from all eight fragments in January–April 2008, but reinvaded within a month; time to eradication averaged 47 nights in fenced and 19 nights in grazed fragments. A second six-night trapping operation in autumn, 1–3 months after eradication, found no effect of fencing (P = 0.73). Connectedness to an adjacent source of immigrants did not influence rat density within a fragment in either season (summer P = 0.25, autumn P = 0.67). An uncalibrated, rapid (one-night) index of ship rat density, using baited tracking tunnels set in a 50 × 50 m grid, showed a promising relationship with the number of rats killed per hectare over the first six nights, up to tracking index values of c. 30% (corresponding to c. 3–5 rats ha–1). The index will enable managers to determine if rat abundance is low enough to achieve conservation benefits. Our results confirm a dilemma for conservation in forest fragments. Fencing protects vegetation, litter and associated ecological processes, but also increases number of ship rats, which destroy seeds, invertebrates and nesting birds. Maximising the biodiversity values of forest fragments therefore requires both fencing and control of ship rats