Britain's economy contracted unexpectedly in the third quarter of this year, squashing hopes of an end to the downturn and instead making the current recession the longest on record, official data showed Friday.

The Office for National Statistics said British gross domestic product fell by 0.4 percent between July and September, versus analysts' expectations of a 0.2 percent rise, meaning the economy has contracted for six successive quarters for the first time since records began in 1955.

Year-on-year, output shrank by 5.2 percent, only marginally better than the record 5.5 percent annual fall registered in the second quarter. The quarterly decline between April and June was unrevised at 0.6 percent.

With an election due by next June, the length of the recession will be an embarrassment to Prime Minister Gordon Brown's ruling Labour Party, particularly as many of Britain's major trading partners are already out of recession.

The government has forecast that growth will resume by the end of the year and is counting on a stronger rebound in the coming years than most independent forecasters.

The ONS said there had been a peak-to-trough GDP fall of 5.9 percent during the current recession, compared to 6.0 percent between the second quarter of 1979 and the first quarter of 1981 -- a period when there were some quarters of growth.

A surprise decline in the services sector was a key factor behind Friday's disappointing figures. The sector contracted by 0.2 percent over the quarter, with the distribution, hotels and catering sub-sector leading the decline with a 1.0 percent quarterly drop.

Economists had already expected industrial output to be weak, following a sharp monthly drop in August, and the GDP data bore this out. Industrial production fell by 0.7 percent over the quarter, taking its annual decline to 10.4 percent.

(Reporting by David Milliken and Christina Fincher)