Image copyright PA

Until recently, new car sales in Britain were booming. In 2016, a record 2.7 million were registered. It was the fifth year in succession that the market had grown.

Now, things look very different.

In September, new registrations fell by 9% compared with the same period the year before, according to the Society for Motor Manufacturers and Traders (SMMT). It continued a downward trend that has been visible for the past six months.

And this week, Pendragon, one of the country's biggest car dealers, issued a surprise profits warning. It said waning demand for new cars and a consequent fall in the price of older vehicles would take a heavy toll on its earnings.

So what's gone wrong?

The first thing to say is that car sales are still pretty strong, by historical standards at least. You can see that from the graph below.

In fact, most analysts had expected sales to tail off this year, if not by the levels we've actually seen.

That's partly because the market is very cyclical. Once people have a car, they tend to keep it for a number of years, and rapid growth is difficult to sustain. But changes in the market have also had an impact.

One of the main factors driving the market has been the growth of so-called Personal Contract Purchase plans, or PCPs, for private buyers. These are essentially leasing agreements, with an option to buy at the end of the contract, typically after three years.

PCPs have proved very popular, in part because they allow buyers to obtain new cars while making lower monthly payments than would normally be required under traditional forms of financing, such as hire purchase. They also encourage people to get new cars more often - because at the end of one contract, many people simply take out another.

But now that growth is tailing off.

"It's running out of steam now," says David Leggett of industry analysts Just-auto.

"The industry has been very adept in getting people on to these schemes, driving them on to three-year replacement cycles. But now, most people who wanted to take out PCPs have done so.

"At the same time, interest rates are going to go up, inflation is rising and household budgets are being squeezed. So a drop-off is to be expected."

Used car sales, meanwhile, have been more resilient. After hitting record levels in the first three months of the year, they fell 0.7% in the second quarter, the most recent period for which figures are available. Anecdotal evidence suggests the brakes may be coming on in this market too.

But according to the SMMT, even though new car sales had been expected to fall this year, the decline has been far higher than expected.

Tamzen Isacsson, the industry group's director of communications, says there have been two main factors at play.

Over the first part of the year, she says, the government put out "very unclear signals about its air quality plans", which hampered demand for diesel cars in particular.

Diesels have been a key target for air quality campaigners, particularly since the Volkswagen emissions scandal erupted in late 2015.

In July, after weeks of speculation, the Department for Environment, Farming and Rural Affairs (Defra) announced that sales of all new diesel and petrol cars would be banned by 2040.

Although the proposed ban doesn't include hybrids and won't come into effect for more than two decades, it does appear to have had an impact on sales.

In September, for example, registrations of diesels were down more than 20% compared with last year - continuing a trend seen over several months.

Sales of electric cars and hybrids have risen sharply, but not enough to make up for the decline elsewhere.

The other major factor, according to the SMMT, is Brexit. Tamzen Isacsson insists it is "the greatest challenge the industry is facing at the moment".

Consumer confidence, she says, is key to the health of the new car market.

"If consumer confidence is low, people delay purchases of big-ticket items like cars.

"With so much confusion about the impact of Brexit and where the economy is heading, it's not surprising they're holding back.

"It is imperative for the future health of the new car market that we get some clarity on this."