U.S. stock indexes were on course to close lower in late-afternoon trading Friday after stemming some of their losses from a steep morning slide. Technology and industrial stocks accounted for much of the decline. Energy companies led the gainers.

The stock market stumbled after former national security adviser Michael Flynn pleaded guilty to lying to the FBI and said he would cooperate with the probe into Russian meddling in the U.S. presidential election. But investors were encouraged after Senate Republicans signaled they have enough votes to push forward on a tax overhaul bill.

THE QUOTE: "The losses that we saw right when the Flynn information came out — the market just hit an air pocket," said Phil Orlando, chief equity strategist at Federated Investors. "The market is trying to sort this out and maybe it doesn't think it's quite as bad as the initial shock when the headlines crossed."

KEEPING SCORE: The Standard & Poor's 500 index fell 9 points, or 0.4 percent, to 2,638 as of 3:23 p.m. Eastern Time, erasing its gain from a day earlier. The Dow Jones industrial average slid 85 points, or 0.4 percent, to 24,186. The average had been down more than 350 points. The Nasdaq composite lost 38 points, or 0.6 percent, to 6,835. The Russell 2000 index of smaller-company stocks gave up 14 points, or 1 percent, to 1,529. The indexes, which hit record highs earlier this week, had been little changed before Flynn's plea deal was announced.

RUSSIA PROBE: A federal judge said that Flynn is cooperating with the wide-ranging investigation led by special counsel Robert Mueller. In pleading guilty Friday to lying to the FBI about his contacts with the Russian ambassador, Flynn admitted he followed directions from an unnamed member of the Trump transition team. Mueller is examining possible coordination between Russia and the Trump campaign to influence the outcome of the 2016 election. Flynn is the first official who worked in the Trump White House to make a guilty plea in the investigation.

TAX CUTS: Investors were keeping an eye on Washington as Republicans moved to make major changes to their proposed tax overhaul package ahead of a vote Friday. Among the changes aimed at appeasing deficit hawks is a rollback of some of the tax cuts after six years. Senate Majority Leader Mitch McConnell said after a closed-door meeting of Republican senators that the GOP has the votes to deliver the legislation, which is expected to add $1 trillion to the nation's deficit over 10 years. It would also slash the corporate tax rate, offer more modest cuts for families and individuals and eliminate several popular deductions.

"The tax bill, in our mind, is going through," said Orlando. "This Flynn situation, the Mueller investigation, does not derail the tax reform, which we think is essentially at hand."

TECH SLIDE: The technology sector, an investor favorite since the beginning of the year, had some of the biggest losses. Qorvo fell $2.47, or 3.2 percent, to $74.11.

NOT QUITE YET: Qualcomm declined 1.3 percent after Bloomberg News reported that Broadcom, a rival chipmaker, won't make a new offer for the company until next year. Qualcomm shed 84 cents to $65.50. Broadcom lost $7.85, or 2.8 percent, to $270.09.

TURBULENT DAY: Several airlines traded lower amid a decline in industrial stocks. American Airlines Group fell $1.26, or 2.5 percent, to $49.23, while Alaska Air Group gave up $2.37, or 3.4 percent, to $66.80.

UGLY OUTLOOK: Ulta Beauty slid 5.9 percent after the beauty products retailer issued a disappointing forecast for the current quarter that overshadowed solid third-quarter results. The stock was the biggest decliner in the S&P 500, dropping $13.18 to $208.53.

NEW RECIPE: Meal kit maker Blue Apron gained 5.7 percent after it named a new CEO. The company has struggled since its initial public offering in June. The stock rose 17 cents to $3.16.

OIL SURGES: Benchmark U.S. crude New York rose 96 cents, or 1.7 percent, to settle at $58.36 a barrel. Brent, the international standard, added $1.10, or 1.8 percent, to close at $63.73 a barrel. On Thursday, the OPEC cartel and a group of allied oil-producing nations agreed to extend output cuts until the end of next year. In other energy futures trading, wholesale gasoline gained a penny to $1.74 a gallon. Heating oil picked up 4 cents to $1.94 a gallon. Natural gas gained 4 cents to $3.06 per 1,000 cubic feet.

The pickup in oil prices helped lift energy stocks. Apache Corp. was the biggest gainer in the S&P 500, climbing $2.27, or 5.4 percent, to $44.10.

BONDS: Bond prices rose. The yield on the 10-year Treasury fell to 2.36 percent from 2.41 percent late Thursday.

CURRENCIES: The dollar fell to 112.05 yen from 112.53 yen on Thursday. The euro weakened to $1.1893 from $1.1896.