Summary This paper presents likelihood analysis of the I(2) cointegrated vector autoregression which allows for piecewise linear deterministic terms. Limiting behaviour of the maximum likelihood estimators are derived, which is used to further derive the limiting distribution of the likelihood ratio statistic for the cointegration ranks, extending Nielsen and Rahbek. The provided asymptotic theory extends also the results in Johansen et al. where asymptotic inference is discussed in detail for one of the cointegration parameters. An empirical analysis of US consumption, income and wealth, 1965–2008, is performed, emphasizing the importance of a change in nominal price trends after 1980.