Former President Barack Obama made a surprise appearance in Northern Virginia Monday to rally supporters for Sen. Tim Kaine and state Sen. Jennifer Wexton on the eve of Election Day, part of a series of stops during the past week to help Democrats win control of at least the House.

Carrying a box of doughnuts, Obama startled a crowd of about 60 mostly young campaign staffers and volunteers inside a Wexton field office in Fairfax County. He cast the election as a referendum on the country’s future.

“You vote, you might save a life; that’s pretty rare when that happens,” Obama told the crowd, referring to the potential for a Republican-controlled Congress to follow through on promises to repeal the Affordable Care Act. Democrats argue that would hurt people with preexisting health conditions.

And he attacked President Trump for what the ex-president has called “fear mongering” and repeated lies.

“Most important, the character of this country is on the ballot,” Obama said. “The politics we expect is on the ballot. How we conduct ourselves in public life is on the ballot.”

The popular ex-president’s appearance was mainly meant to boost Wexton in her race against Rep. Barbara Comstock (R) in the 10th congressional district that stretches from McLean toward the West Virginia border. The seat has been in Republican hands for nearly 40 years and the serious challenge from Wexton has made it one of the most closely watched contests in the country.

Wexton (D) held an 11-point lead over Comstock in a Washington Post-Schlar School poll conducted late last month.

But Comstock — a tenacious campaigner with deep roots in the district who is seeking a third term — has outraised the Democrat $5.8 million to $5.4 million.

In the Sentate race, Kaine is ahead of Republican challenger Corey A. Stewart by nearly 20 points in most polls while outraising him by a nearly 10-1 margin, with $22.3 million.

His voice hoarse from rallies in Miami, Chicago, and Gary, Ind., in recent days, Obama called Wexton, a former Loudoun County prosecutor, “part of a wave or remarkable candidates that we’re seeing all across the country.”

That wave includes more women and military veterans running for Republican-held seats, he said.

“People who didn’t start off saying to themselves: ‘I want to be a politician,’ but rather, started off saying: ‘I want to serve,’” Obama said.

The former president called Kaine a model of “decency and compassion and doing what you believe is right, even if it’s not politically expedient.”

Kaine “is somebody who I have witnessed do that time and time again,” Obama said.

Both Wexton and Kaine basked in the adulation that the crowd showed for Obama.

Wexton called the former president’s historic victory in 2008 her inspiration for seeking office.

“I have really said, since day one, that my campaign is not about gloom and doom,” she said. “My campaign is about hope and change.”

Kaine echoed Obama’s message about the high stakes of the midterm election.

“Even more than a blue wave, what this nation needs right now, what this world needs from us right now is a wave of compassion, a wave of character,” he said. “That’s what’s on the ballot tomorrow night.”

Nancy Davis, who has been knocking on voters’ doors for Wexton, said she agrees with that characterization.

Still, as she looked out the window at a rainy morning on Monday, Davis, 71, said she briefly considered taking the day off from campaigning.

The Obama appearance made her glad she decided to brave the wet weather, she said.

“My husband said: ‘Don’t go. It’s raining,’” Davis said, while watching Obama pose for selfies with other supporters and hoping he’d make his way through thick crowd toward her.

Davis never got to meet Obama. But she was nonetheless energized to knock on more doors Monday.

“We get to send a message this election, that we don’t accept hate and we don’t accept fear,” Davis said, heading toward a volunteer sign-in table as a small group began chanting an Obama campaign mantra: “Fired up, ready to go!”