The UK economy contracted 0.2% between April and June, its worst performance since 2012, the Office for National Statistics said.
The surprise contraction came after a boost to economic growth in the first three months of the year because of Brexit stockpiling.
Rob Kent-Smith, head of GDP at the ONS, said manufacturing output fell and the construction sector weakened.
The pound slipped after the data was released, raising fears of a recession.