WASHINGTON—The coronavirus shutdown will induce the sharpest economic downturn and push the U.S. budget deficit to the highest levels since the 1940s, the Congressional Budget Office projects.

The economy is likely to shrink 12% in the second quarter—a 40% drop if it were to persist for a year—and the jobless rate will average 14%, the nonpartisan research service said Friday. Job losses will come to 27 million in the second and third quarters.

The federal budget deficit is expected to reach $3.7 trillion by the end of the fiscal year on Sept. 30, the CBO said, up from about $1 trillion in the 12 months through March. Congress has authorized unprecedented deficit spending to offset the shutdown of vast swaths of the U.S. economy.

As a proportion of gross domestic product, the deficit will end the fiscal year at almost 18%, its highest level since the year after World War II ended and up from 4.6% in 2019, the CBO said.

Federal debt held by the public is projected to hit 101% of gross domestic product by the end of the fiscal year, up from 79% at the end of fiscal 2019, the CBO said.