Tuesday's midterm election may spur some near-term volatility, but history shows the stock market typically rises the year after the off year contests — even with a recession. The year following midterms has historically been a strong one for the S & P 500 , with the benchmark gaining 20.1% on average, according to Citigroup data going back to 1960. Even when there's a recession the next year, returns are surprisingly robust, with the S & P 500 rising 24.4% on average during three instances in 1974, 1990 and 2006, Citi said. That's especially pertinent now, with many economists expecting an economic downturn in 2023 in the wake of the Federal Reserve's aggressive rate hikes to tame inflation. The midterm elections will decide whether Democrats keep their slim majorities in the House and Senate, or if Republicans seize control of one or both chambers of Congress. "Equities typically perform well following midterm elections as political uncertainty declines," Ben Snider, Goldman Sachs senior strategist on the U.S. Portfolio Strategy macro team, said in a research note. "Equity returns have generally been slightly stronger under divided governments than when one party has unified political control." Republicans have been consistently favored to win control of the House, but the Senate looks like a toss-up that could come down to even a single race. A divided government could be more beneficial to the market by making big policy shifts even more difficult to pass, Goldman said. "Political uncertainty may also help explain why S & P 500 returns have generally been slightly weaker when one party has had unified control of both the White House and Congress than under divided governments, when major changes in policy are less likely," Snider said. — CNBC's Michael Bloom contributed reporting.