Virginia Senate Democratic candidate Debra Rodman visits voter Elise Ward, left, at her home in Richmond, Virginia. Rodman is one of many Democrats trying to flip GOP seats in Virginia to give the Democrats a majority in the state legislature. Off-year elections are being held in a handful of states Tuesday. Steve Helber/The Associated Press

Tuesday’s elections in a handful of states will test Democrats’ ability to expand their appeal to moderate voters in the South on social issues such as gun control and the environment, as well as provide an assessment of President Donald Trump’s ability to rally Republicans amid an impeachment investigation.

Voters in five states and numerous localities are holding off-year elections for legislatures, governors and a handful of other offices. The elections are drawing national attention, with Trump and Vice President Mike Pence making appearances for local Republicans, and Democrats using their gun control message to try to regain control of a critical statehouse.

In Virginia, party control of the legislature is the big prize in a state where Republicans now hold sway by tiny margins — 20-19 in the Senate and 51-48 in the House of Delegates, where the majority was decided in January 2018 in a tied race by pulling a name out of a bowl.

There are closer-than-expected gubernatorial races in Kentucky and Mississippi.

Kentucky GOP Gov. Matt Bevin models himself on Trump, but has put off some voters with his bluster. A recent Morning Consult survey rated Bevin the governor with the highest disapproval rate in the country. His challenger, Democratic Attorney General Andy Beshear, is popular and is giving Bevin a tough fight over raising revenue to pay teachers more, for example.

Much of the race revolves around Bevin’s efforts to tie himself to Trump and to bring up the Democrats’ — and by inference Beshear’s — support for impeaching the president. Beshear had been leading in the polls, but a recent Mason Dixon Line poll shows the two nearly tied.

How Voter Access Laws and Passion Brought People to the Polls Quick View How Voter Access Laws and Passion Brought People to the Polls Turnout in 2018 was 53%, up 12 points from 2014.

“Everything’s becoming more nationalized, including these state races,” said Kyle Kondik, an analyst and spokesman for the University of Virginia’s Center for Politics. He cited Louisiana’s gubernatorial race as another example, in which Gov. John Bel Edwards, a Democrat, faces a challenge from Republican Eddie Rispone.

“If John Bel Edwards were to lose, it would be mostly a function of federalized partisanship influencing a state race,” Kondik said. “An incumbent governor with his favorability ratings wouldn’t have been in trouble a decade ago. A governor like Matt Bevin, with low approval ratings, would have been in a lot more trouble than he’s in.”

Kondik said “animus” in Virginia is motivating voters who oppose Trump to vote Democratic. “Republicans hope a lower turnout election will help them retain control of the state legislature.

“The expectations of a lot of people are that the Democrats are favored in Virginia, Republicans in Kentucky and Louisiana,” Kondik said. “We will have to see if local factors outweigh the federal partisanship.”

Republicans typically would be favored in Mississippi as well, one of the reddest states in the country, but GOP Lt. Gov. Tate Reeves is in an unexpectedly tight race with Democrat Jim Hood, the attorney general. That prompted Trump to hold a rally in Mississippi for Reeves Friday night, followed by a Pence visit Monday. Trump also planned to visit Louisiana and Kentucky.

Louisiana’s election runoffs don’t occur until Nov. 16, when Edwards will see whether his popularity in the more moderate suburbs can offset the GOP’s hold on rural counties. Edwards walks a tightrope in the state, mostly hewing to liberal social issues such as expanding Medicaid but maintaining an anti-abortion stance in a nod to the state’s religious and conservative voters.

Gun issues have turned out major donations in Virginia, where a shooter in Virginia Beach killed 12 people and wounded four others at an office in May.

Democrats in Virginia are stressing gun restrictions because many of the closest races are in suburban and exurban counties, rather than in rural counties where gun control doesn’t play well. Anti-gun activist former New York Mayor Michael Bloomberg and his group Everytown for Gun Safety have donated heavily to Democrats in the Virginia races. The National Rifle Association, meanwhile, has donated heavily to Republicans.

Following the shooting, Democratic Gov. Ralph Northam called a special legislative session, urging lawmakers to take up a gun-control package that included a red flag law and universal background checks. Republicans, however, voted to adjourn less than two hours into the session, leaving any chance at enacting gun limits until after the November election. Those chances improve if there’s a Democratic victory in the Old Dominion.

Democrats also are counting on turning out their voters. Off-year elections traditionally are low-turnout affairs, but animosity toward Trump and gun issues are motivating some Democrats and could drive up turnout.

Voter Access Matters in 2020, and These Lawmakers Know It Quick View Voter Access Matters in 2020, and These Lawmakers Know It Republicans tightened laws in a few key states. Democrats, meanwhile, opened access.

Andra Gillespie, a political science professor at Emory University in Georgia, said Democrats seem to have the upper hand on gun control because that’s one issue where progressive city dwellers and rural gun owners can find common ground over measures such as background checks.

“Where you start to enter more dicey territory is when you start talking about outright banning guns or buy-back measures,” she said.

Democrats particularly in the South must balance appeals to more conservative voters with the possibility that energizing progressive voters in the cities might produce bigger turnouts, leading to more electoral success, Gillespie said.

“Part of the tension in the debate around Democratic politics is whether you can assume that just because a state is Southern or Midwestern, the Democrats are going to be more conservative,” she said. “In urbanized populations such as in Georgia or Virginia, there are a lot of progressive voters who might increase the turnout.”

Other political races being conducted Tuesday include:

A special election for a state House seat in Missouri’s St. Louis suburbs that is seen as a reflection of the country’s feelings about Trump. The district supported Trump by 5 percentage points, but it also voted for Democratic Sen. Claire McCaskill, who lost her reelection bid.

A special election for a Texas state House seat in a suburban Houston district where Democrat Beto O’Rourke (who dropped out of the presidential race Friday) won more votes for U.S. Senate than Sen. Ted Cruz, a Republican, in 2018.

General Assembly races in New Jersey, where Democrats hope to expand their majority in a state where their party already holds a trifecta — the governorship, the state Senate and the General Assembly. State senators are not up for re-election this year.

Statewide ballot measures in several states, including allowing sports betting in Colorado, adding a Marsy’s Law to enhance crime victims’ rights in Pennsylvania, making it harder for Texas to implement an income tax and restoring affirmative action policies in Washington state.

Forty-five local ballot measures among local jurisdictions in 13 different California counties.

Stateline staff writer Matt Vasilogambros contributed to this story.