The major equity indexes were lower on Friday, whipsawed by developments with a probe into Russia’s alleged involvement in the election as well as with progress on a tax bill in Congress.

However, stocks recouped the bulk of their initial losses, after Senate Republicans said they had enough support to pass a sweeping tax overhaul. The Senate news was the latest sign of progress for a tax bill being closely watched by investors, with hopes that significant corporate tax cuts will further fuel Wall Street’s record-setting rally.

Steep sell-offs have been a rarity on Wall Street this year. The S&P 500 has ended the trading day down by at least 1 percent only four times in 2017.

Progress with the tax legislation in the Senate had helped buoy stocks this week, as well as drive a rotation into those areas that seem poised to benefit from lower corporate taxes.

The S&P has rallied as much as 18 percent this year, due in no small part to solid global economic data and strong corporate earnings. At the same time, there have been aspects of Trump’s domestic agenda, especially tax cuts along with news involving his administration that has periodically rattled the markets.

Nonetheless, each selloff does not fail to prompt Wall Street’s favorite reaction in recent months: “Buy the dip.”

The energy sector was the best-performing sector, rising 0.8 percent. Oil prices ended the day with a slight gain, the day after OPEC and other crude producers agreed to extend output cuts until the end of 2018 to tighten global supplies and support prices.

Approximately 8.2 billion shares changed hands on the major domestic equity exchanges, a number that was well above the 6.6 billion share daily average over the past 20 trading days, according to Thomson Reuters data.