After global stock markets nose-dived earlier this year, they have been rebounding since late March, as investors have routinely looked past evidence of the damage caused by stay-at-home orders and business shutdowns, and instead focused on hopes for an eventual recovery. The gains on Friday mean stocks ended the week higher, despite reports showing a historic plunge in retail sales and a continued surge in unemployment claims.

The S&P 500 is now up more than 28 percent from its lowest point this year, which was reached on March 23. It is still nearly 18 percent below its high in late February.

On Friday, the rally came after China reported that its economy — the world’s second-largest after that of the United States — shrank for the first time in decades. And data on car sales in Europe showed they collapsed.

Some also saw hopeful signs in a report by the medical news website STAT that a drug from Gilead Sciences showed early — and, thus far, unproven — promise in fighting the coronavirus. According to STAT, the antiviral drug, remdesivir, has helped patients with severe symptoms recover rapidly in a clinical trial at a Chicago hospital. Gilead’s shares jumped nearly 10 percent.

The Trump administration plans to funnel $19 billion to farmers.

President Trump said Friday he would channel $19 billion to American farmers and ranchers that have been hurt by the fallout from coronavirus, payments that come on top of tens of billions of dollars of assistance given to farmers in the last year to offset the pain of the trade war with China.

The Trump administration will make $16 billion in direct payments to farmers who have experienced losses from coronavirus, Mr. Trump said in a briefing Friday evening. It would also purchase a further $3 billion of fresh produce, dairy and meat that will be distributed through food banks and other community and faith organizations to people in need, he added.

“These are great people, great Americans,” Mr. Trump said. “It is money well deserved. Not only were they targeted at one point by China, that was over a period of time, and they never complained.”