U.S. stocks posted their best week since April, although ended the day flat, as investors weighed soaring coronavirus infections, the weakening economic recovery and a yet-to-be called presidential race.

The Dow Jones industrial average fell nearly 67 points, or 0.2 percent, Friday to close at 28,323.40. The S&P 500 dropped a point, or 0.03 percent, to end at 3,509.44, and the tech-heavy Nasdaq 100 edged up more than 4 points, or 0.04 percent, to settle at 11,895.23.

For the week, the S&P 500 climbed 7.3 percent, the Dow added 6.9 percent, and the Nasdaq 100 jumped more than 9 percent.

Investors are waiting for a decision in the presidential race. As of 4 p.m., Joe Biden was ahead of President Trump in Pennsylvania and Georgia. Although the counts are ongoing, clinching either state would put Biden over the 270 electoral votes needed to win the White House, even as a handful of other states remain too close to call.

Stocks soared this week as the prospect of a GOP-controlled Senate reduced the likelihood that a Biden presidency would usher in tax increases and sweeping regulatory changes. Senate Majority Leader Mitch McConnell (R-Ky.) would be able to block market-rattling Cabinet appointments, such as Sen. Elizabeth Warren (D-Mass.), as treasury secretary.

“A split Congress is going to make it very difficult for Biden … to deliver on some of his more ambitious policies, many of which were widely viewed as market negative,” Craig Erlam, senior market analyst with OANDA, wrote in comments emailed to The Washington Post. “The failure to secure the blue wave also means any stimulus will be smaller than it would have otherwise been, but the way markets have responded, they’re viewing it as a small price to pay for stability.”

Daniel Ives, an analyst with Wedbush Securities, called this a “goldilocks outcome” for tech in particular, which could explain the Nasdaq’s buoyant performance this week after a run of sell-offs.

“With the Republicans likely to control the Senate, the chances of major legislative changes to antitrust law now is off the table in the eyes of investors, which posed the biggest risks to tech stalwarts, with a ripple impact across the sector,” Ives said in comments emailed to The Post.

While the nation awaits final election results, the coronavirus pandemic rages on. The United States posted a record 116,707 new coronavirus infections on Thursday, as 20 states posted their highest daily counts yet, and fatalities surpassed 1,000 for the third consecutive day. At least 235,000 Americans have died of covid-19, according to The Post’s data.

The pandemic’s surge could stall the economic recovery, which is showing signs of tapering. The unemployment rate fell from 7.9 percent to 6.9 percent in October as the economy added 638,000 jobs, the Bureau of Labor Statistics reported Friday. The gain is the smallest since May but beat analysts’ expectations.

Eleven million people remain unemployed, according to the Bureau of Labor Statistics — about twice the amount from February, before the pandemic took hold in the United States.

“Today’s report highlights the challenge for lawmakers as the impulse for additional fiscal stimulus hangs in the balance between the pace of the economic recovery and the downside risks of the public-health crisis,” Charlie Ripley, senior investment strategist for Allianz Investment Management, said in comments emailed to The Post.

In Europe, skyrocketing cases are prompting curfews and new business and travel restrictions. Italy and France tightened shutdown measures this week, while Greece announced a three-week lockdown to try to tame spread of the coronavirus.

The worrying signs of pandemic resurgence are rattling investors. By the end of Friday’s trading, European indexes were negative across the board. Germany’s DAX shed 0.7 percent, while France’s CAC 40 was down nearly 0.5 percent. Europe’s benchmark Stoxx 600 was down 0.2 percent.

Gold, a safe haven in times of turmoil, was trading up nearly 0.4 percent at $1,953 per ounce.

Oil markets tumbled Friday as rising coronavirus cases worldwide threatened to spark more shutdowns, threatening demand for gas and other petroleum products. West Texas intermediate crude, the U.S. oil benchmark, fell 3.6 percent to $37.40 per barrel. Brent crude, the international oil benchmark, was off nearly 3 percent, trading at $39.71 per barrel.