Former D.C. mayor Vincent Gray departs after casting his ballot at Precinct 113 in Ward 7 in Washington on Tuesday. (J. Lawler Duggan/For The Washington Post)

At the River Terrace Elementary School Tuesday afternoon, Deborah Best, a 63-year-old cashier and foster grandmother, cast a ballot for former D.C. Mayor Vincent C. Gray and for second chances.

“They had nothing,” said Best, referring to federal prosecutors whose investigation into illegal financing of Gray’s 2010 mayoral campaign plunged the politician in scandal and doomed his 2014 re-election bid. “I’ll give him another chance.”

Gray is seeking a political comeback in the city’s Democratic primary as he challenges incumbent Yvette M. Alexander for the D.C. Council seat for Ward 7. Six of Gray’s friends and associates pleaded guilty in the campaign finance scandal; he was never charged.

In the early evening, Gray stopped by River Terrace Elementary to greet voters as they trickled in after work.

“I feel wonderful,” he said.

Asked if he planned to run again for mayor, he said it is “not my intent” but “it would be foolish for me to rule anything out...I don’t know; we’ll see what happens.”

In addition to the Ward 7 seat, D.C. Democrats will decide three other council races and vote in the last Democratic presidential primary in the nation, between Clinton and Sen. Bernie Sanders of Vermont — although that seems a futile effort, as Clinton has already amassed enough delegates to be the party’s nominee.

As of 5 p.m., turnout was extremely light - about 16 percent of registered voters eligible to cast ballots in party primaries.

Voters reported multiple problems in casting ballots Tuesday, raising the possibility that technical issues could mar the election.

An unknown number of voters said that when they showed up at polling sites on Tuesday, they discovered their party affiliation had been switched without their knowledge in city records -- often from “Democrat” to “N-P,” or no party, preventing them from casting regular Democratic Party ballots.

The D.C. Board of Elections acknowledged Tuesday afternoon that a technical error was likely at fault. The board said the problem appeared to be rooted in its new Web app and that “some voters who updated their registration information through the mobile app may have experienced an unintentional change in their party affiliation.”

Michelle Kuchinsky, 26, who work for a labor union, said her party affiliation was changed without her knowledge but she never used the app.

“I don’t think this has anything to do with the app,” said Kuchinsky, who got a notification that her party registration had changed from Democrat to Statehood Green Party a few months ago, and was able to reverse it then in order to vote as a Democrat on Tuesday.

Council member David Grosso (I-At large) said his wife observed a similar problem that a voter in line in front of her experienced Tuesday, having the wrong party affiliation. He said the voter was allowed to change his registration on the spot.

“I’m worried this could be widespread,” Grosso said in an interview. “And it’s something that people wouldn’t be looking for, why would you ever check to make sure your party hadn’t changed on you?”

A spokesman for the board of elections said any voter who was registered under the wrong party affiliation was permitted to vote with a “special ballot’. The board will not count special ballots until Friday, the spokesman said.

As Gray left his polling place, Alexander voter Brian Boger challenged him to account for the Walmart the former mayor promised to build in Ward 7.

“Where’s our Walmart?” Boger asked as Gray walked to the car. “If we had a Walmart, there would be jobs.”

Boger, 55, volunteered for Gray’s mayoral campaign but lost trust in him after the campaign-finance controversy.

“Any vote for Gray is a vote for corruption and scandal,” said Boger, the owner of a landscaping and home-improvement business.

Alexander made positive changes in the neighborhood where Boger has lived his entire life, he said. To him, she represents opportunity, while Gray reflects only a tarnished history.

“She’s clean,” he said, referring to Alexander. “She honors the neighborhood.”

For Robin Cook, 55, the former mayor’s connection to an illegal campaign-financing scheme was just a distraction. Should he run for mayor again, she said she would support him.

“To me, everybody has some skeleton in their closet,” said the University of the District of Columbia professor.

Gray was an active community leader in Ward 7 as a council member and mayor and visited Cook’s church multiple times, she said. He genuinely cared about the ward’s residents, she said, and “seemed to be doing good for us.”

Alexander, in contrast, was invisible, Cook said. “I haven’t seen her except when it’s time to vote. I haven’t seen anything she’s done.”

At the Pennsylvania Avenue Baptist Church in Southeast, Gladys Dorn-Hall cast a vote for Gray, her third time voting for the candidate

Dorn-Hall, 80, doesn’t care about the politics. She doesn’t care about the investigation into Gray’s campaign financing. She cares that he cares, and that’s good enough for her.

“I just believe that he really loves D.C.,” the retiree said. “It’s important to love your home, even if people think it’s shabby.”

Dorn-Hall took a similar approach to the presidential primary, disregarding scandal to vote for Clinton because “she’s the smartest one out there.”

Across the city, Evan Sims, a 79-year-old federal government employee and Ward 4 resident, felt frustrated that his vote for Clinton came after she had already secured enough support to win the Democratic nomination.

“I thought about that: Why vote for someone who already won?” said Sims, who cast his ballot at a Brightwood police station. “We are always way behind everyone else, and I don’t think that’s right.”

Outside the Fort Stevens Recreation Center in Northwest, Rosa Lee said she supported Sanders because she felt Clinton hadn’t been forthcoming about mistakes she made in handling a private email server, among other things. Lee plans to vote for a third party candidate in the general election.

“It’s sad the choices we have in the elections this year: one that’s a complete nut and the other who is dishonest,” said Lee, a 68-year-old retiree, referring to Republican front-runner Donald J. Trump and Clinton.

Anna Roblin showed up to vote at Shepherd Elementary School wearing a hand-drawn sign pinned to the back of her sweater that said “Bernie Cares Sanders 2016” and three campaign buttons.

“He’s always stuck up for the environment and stuck up for poor people, and Hillary has not,” said Roblin, a 53-year-old substitute teacher who is holding out hope that superdelegates to the nominating convention will switch their votes from Clinton to Sanders. “She lies like a rug, and everything she says is for political expediency.”

Because 3 out of 4 voters in the District are registered Democrats, the primary election is tantamount to the general election. Polls in the city opened at 7 a.m. and will close at 8 p.m It is a closed primary; only voters registered as Democrats, Republicans and D.C. Statehood Green party members can participate. The only contested races are among Democrats.

In Ward 8, voters face a rematch between incumbent LaRuby May and challenger Trayon White in what could be the closest contest Tuesday. In the crowded special election in April, May topped White by 79 votes.

Ward 8 voters said they judged candidates based on how much attention they give to fixing the schools and how much they embrace major commercial developers who might upgrade residential home values, but at the cost of displacing longtime residents.

“I voted for LaRuby last time. I had a lot of hope for her, but she didn’t really come through other than her web site sending out job openings,” said Danielle Cotten, 32, a federal government contracting officer, who emerged from Anacostia Senior High School after voting for White. “Trayon is from this area. He knows the people’s needs. He’s been involved in neighborhood associations. He is more for the people’s needs, before major corporations [that might bring commercial development to Ward 8]. And he’s more geared to help fix real issues here -- homelessness, drugs, school retention and graduation rates.”

David Brown, a retired carpenter who runs a local education non-profit, said he, too, voted for White because he seemed to care more about public schools than the other candidates.

“I don’t know a thing about May,” he said. “I know she’s not from here.”

There was a surprising turnout for a third, lesser-known candidate, Aaron Holmes. Last month, in a straw poll of Ward 8 voters, White nabbed 135 votes, May got 50 and Holmes only earned 8. Still, far more voters who spoke to the Post on late Tuesday afternoon said they went with Holmes over May.

Emil and Nina Ashford, husband and wife, said they were a house divided: he voted for Holmes, she for May.

“I’ve never seen her around here much and we both go to many [Advisory Neighborhood Commission] meetings,” Emil said. “And I’ve seen Holmes around much more.”

In Ward 4, council member Brandon T. Todd, a former campaign-finance chairman for Mayor Muriel E. Bowser (D), faces his biggest threat from Leon Andrews, who has questioned Todd’s support for the Pepco-Exelon merger and close backing of other Bowser policies.

Outside a Petworth polling station Tuesday morning, Lauren Wingo said she voted for Andrews, who she saw as a fixture at community events. Although she is content with Bowser’s tenure so far, she thought Todd was too closely aligned with the mayor.

“Balancing opinions is always useful,” said Wingo, a 27-year-old engineer.

But Charletta Lewis said she voted for Todd precisely because of his good working relationship with the mayor.

“He’s able to take our concerns straight to Mayor Bowser, and they have a great connection and relationship,” said Lewis, a 37-year-old mental health specialist who voted at Shepherd Elementary School.

In the at-large race, Vincent B. Orange, who has served a dozen years on the council, is facing challengers Robert White and David Garber.

Tillman Peck, a Ward 4 resident since 1974, said he sees no reason to vote out incumbents unless they have done something wrong. And he had not heard any reasons to kick out any council member, but he did recall meeting energetic volunteers for White.

“Perhaps if he surfaced a month or two earlier, I might have looked into him, but I don’t think he’s a household name going back 10 years,” said Peck, a 73-year-old federal employee who voted for Orange.

In Virginia, there are contested primaries in three of the state’s 11 congressional districts, some of which were turned upside down by a recent court ruling about redrawing the congressional-district map. Polls are open from 6 a.m. to 7 p.m.

U.S. Rep. J. Randy Forbes (R-Va.) opted against running for reelection in his Richmond-area 4th District and is instead trying for a win in the 2nd District, anchored by Virginia Beach. He faces a challenge from Del. Scott W. Taylor (R-Virginia Beach), a former Navy SEAL, and attorney Pat Cardwell.

Democrats think they have a good chance of turning Forbes’s old district blue. Under the new boundaries, the district gained African American voters who reliably vote for Democrats, according to exit polls. In that district, state Sen. A. Donald McEachin (D-Henrico) is taking on Ella Ward, a council member in Chesapeake City; both candidates are black.

In addition to a contested Republican primary in the 4th District, Rep. Bob Goodlatte (R-Va.) will face a lesser-known challenger, Harry Griego, in the 6th District, which includes Roanoke and Lynchburg.

Locally, there is also an unusual Democratic primary, with the Arlington County Board chair facing a primary challenge for the first time in 14 years.

Libby Garvey, a first-term incumbent, aggravated party activists two years ago when she supported a Republican who was running as an independent against another Democrat in a County Board race. Newcomer Erik Gutshall has been hammering away at Garvey’s record on the board.

Aaron C. Davis, Elise Schmelzer, Patricia Sullivan and Jenna Portnoy contributed to this report.