The U.S. economy in the first quarter shrank at its fastest pace since the last recession as the coronavirus pandemic shut down large parts of the country, ending the longest economic expansion on record.

Gross domestic product, the broadest measure of goods and services produced across the economy, contracted at a seasonally and inflation adjusted annual rate of 4.8% in the first three months, the Commerce Department said Wednesday. The decline marks the beginning of a near-certain recession, economists say, and is the biggest drop in quarterly economic output since the fourth quarter of 2008.

The Federal Reserve separately on Wednesday pledged to use “its full range of tools to support the U.S. economy in this challenging time,” according to a statement released after a rate-setting meeting where it left interest rates near zero and didn’t announce any new policy measures.

Federal Chairman Jerome Powell said the U.S. economy would need additional spending from Congress and the White House to ensure that a robust recovery could take hold following a broad and deep deterioration from the pandemic. Congress and President Trump already have provided more than $2.6 trillion in several economic assistance measures over the last two months.

Stocks rose on the hopes of progress for a coronavirus treatment and the Fed’s pledge to maintain support for an eventual recovery. Mr. Powell said the central bank “is going to be very patient, we’re not going to be in any hurry to move rates up.”