Population modelling is an invaluable tool for identifying effective management strategies for threatened species whose populations are too small for experimental manipulation. Recently developed Bayesian approaches allow us to combine deterministic models with probability distributions to create stochastic models that account for uncertainty. We illustrate this approach in the case of the takahe Porphyrio hochstetteri, an Endangered flightless rail, which is supported by one of New Zealand's costliest recovery programmes. Using mark–recapture and logistic regression models implemented in a Bayesian framework we calculated demographic parameters for a fully stochastic population model based on 25 years of data collected from the last wild population of takahe in the Murchison Mountains, Fiordland. Our model results show that stoat trapping, captive rearing and cross-fostering of eggs/chicks in wild pairs all have a positive effect on takahe demography. If it were not for these management actions the Fiordland population would probably be declining (λ = 0.985; confidence interval, CI = 0.39–1.08), with a non-negligible risk of quasi-extinction (P = 16%) within 20 years. The captive rearing of eggs and chicks has been the main factor responsible for the positive growth observed during the last decade but in the future expanding stoat trapping to cover the entire Murchison Mountains would be the single most beneficial management action for the takahe population (λ = 1.038; CI = 0.86–1.10), followed by captive rearing (λ = 1.027; CI = 0.85–1.09).