In this paper, a new compounding distribution, named the Weibull--Poisson distribution is introduced. The shape of failure rate function of the new compounding distribution is flexible, it can be decreasing, increasing, upside-down bathtub-shaped or unimodal. A comprehensive mathematical treatment of the proposed distribution and expressions of its density, cumulative distribution function, survival function, failure rate function, the kth raw moment and quantiles are provided. Maximum likelihood method using EM algorithm is developed for parameter estimation. Asymptotic properties of the maximum likelihood estimates are discussed, and intensive simulation studies are conducted for evaluating the performance of parameter estimation. The use of the proposed distribution is illustrated with examples.