By Jason Douglas and Paul Hannon

LONDON -- The U.K. economy shrank by a fifth in April, a record decline that exposes the cost of nationwide lockdowns on the world's advanced economies.

The U.K. economy shrank 20.4% in April compared with March, and was 24.5% smaller than the same month a year earlier, figures from the Office for National Statistics showed Friday. That was the largest monthly fall in output since comparable records began in 1997, the ONS said.

Industrial production fell 20.3% on month, led by manufacturing output, which fell by almost a quarter as factories ground to a halt.

Output in the U.K.'s services sector, which accounts for around 80% of the economy, shrank 19% on month, as hotels, restaurants, theaters and other businesses closed their doors.

The U.K. is among only a handful of economies that report monthly national output data. The figures offer one of the first detailed glimpses of the cost of the coronavirus-induced shutdowns on a major economy. U.S. gross domestic product figures for the second quarter are due to be published July 30.

The new coronavirus that first emerged in China late last year has now infected at least 7.5 million people world-wide and killed at least 421,000, according to figures compiled daily by Johns Hopkins University.

The U.K. has been among the worst hit, with 41,000 deaths linked to the pathogen. The true cost in lives is presumed to be far higher given gaps in testing.

Most major economies imposed strict social-distancing rules and stay-at-home orders earlier this year to contain the virus's spread. Those lockdowns effectively put huge chunks of the global economy in the deep freeze. Economies have in recent weeks begun slowly reopening.

The Organization for Economic Cooperation and Development forecasts the global economy will shrink 6% this year, rising to 7.6% if a second wave of infection washes over big economies.

Write to Jason Douglas at jason.douglas@wsj.com and Paul Hannon at paul.hannon@wsj.com