Time series in many areas of application often display local or global trends. Typical models that provide statistical explanations of such trends are, for example, polynomial regression, smooth bounded trends that are estimated nonparametrically, and difference-stationary processes such as, for instance, integrated ARIMA processes. In addition, there is a fast growing literature on stationary processes with long memory which generate spurious local trends. Visual distinction between large variety of possible models, and in particular between deterministic, stochastic and spurious trends, can be very difficult. Also, for some time series, several trend generating mechanisms may occur simulteneously. In this paper, a class of semiparametric fractional autoregressive models (SEMIFAR) is proposed that includes deterministic trends, difference stationarity and stationarity with short- and long-range dependence. Parameters characterizing stochastic dependence and stochastic trends, including a fractional and an integer differencing parameter, can be estimated by maximum likelihood. deterministic trends are estimated by kernel smoothing. In combination with automatic model an bandwidth selection, the proposed method allows for flexible modelling of time series and helps the data analyst to decide whether the observed process contains a stationary short- or long-memory component, adifference stationary component, and/or a deterministic trend component. Data examples from various fields of application illustrate the method. Finite sample behaviour is sudied in a small simulation study.