Early voters line up outside a polling station in Silver Spring on Oct. 27, 2012. (Gary Cameron/Reuters)

Voters in the District and Maryland overwhelmed election officials at several polling places Saturday when the larger-than-expected crowds took advantage of the first day of early voting to cast ballots.

Officials said thousands showed up at voting sites, spurred on by President Obama’s plea to vote early and concerned about the threat posed by Hurricane Sandy. Several polling officials found themselves in a midday scramble to install more voting machines to handle the throngs.

Long lines and lengthy waits were reported at polling places in Montgomery and Prince George’s counties as well as in the District’s eight wards. Some voters, frustrated by the delays, left before casting their ballots.

“We didn’t expect all these people to come out,” said Anthony F. Coachmen, a poll captain at the Columbia Heights Community Center in Ward 1. “It was a surprise.”

The line to vote there snaked around the gymnasium as residents waited to use one of the six machines.

“I’m guessing they have some kind of big kinks they have to work out inside there,” said Brent Elrod, 51, who left without voting. “It seems unfortunate there are so few machines.”

In Maryland, voters reported few problems with machines, but elections officials were stunned by a heavy turnout that appeared to be driven mostly by Democrats. By 5 p.m., 53,463 ballots had been cast at 46 early-voting locations, two-thirds of them from registered Democrats.

“We always thought we would be busy. Just didn’t think we would be this busy,” said Paul Aumayr, voting systems director for the Maryland Board of Elections. “Nowhere is quiet.”

Donna J. Duncan, a director of elections for the state, said it appeared that many residents wanted to vote before the storm. She said she expects turnout to be heavy on Sunday as well; early -oting sites in the state will be open from noon to 6 p.m.

Paul Stenbjorn, a D.C. Board of Elections official, said he, too, believed that some residents decided to vote in advance of the approaching storm.

“This is the equivalent of people going to Safeway and buying the milk and the bread,” Sten­bjorn said.

District elections officials said they were particularly surprised by the large turnout in some heavily Democratic areas of the city where early voting had been light in past elections, a sign that Obama’s efforts to get his supporters to vote early may be working.

By 5 p.m. Saturday, at least 2,500 District residents had voted, a sizable number considering that 266,000 ballots were cast during the 2008 election.

In some wards, polling locations were expected to stay open well past the planned 7 p.m. closing so everyone in line could have a chance to vote.

“It looks like Election Day out there, to be quite honest,” said Stenbjorn, adding that officials worked through the day to nearly double the number of voting machines available.

At the King Greenleaf Recreation Center in Southwest shortly after noon, some voters were waited to cast ballots more than two hours after arriving.

“This is just disgusting,” said Gail Ridley, who arrived about 10:30 a.m.

Michele Falkenau had been waiting an hour and 40 minutes. “I came from Florida, the land of the hanging chads,” she said. “I never had to deal with any of this.”

Elections director Clifford D. Tatum, who was assisting voters at the recreation center, said the process was complicated by unexpectedly high turnout and an unusually lengthy ballot this year. In past elections, he said, each machine could store all of the different ballot styles used citywide. This year, the nearly 700 different ballots had to be distributed among several machines, each with particular ranges of precincts on them.

Although elections officials provided a second machine for voters from the precincts closest to each of the eight voting centers, it was not nearly enough. By midday, they were scrambling to add a third and fourth machine to each polling place. Voters from across town could cast ballots with little delay, however.

Daniel Johnson and daughter Danielle Carter came to King Greenleaf after encountering long waits at the Dorothy I. Height Benning Library in Ward 7, near their home in Deanwood. Instead of the two-to-three-hour wait there, they found a wait of 30 to 45 minutes across the river.

Carter said she’d expected to wait 15 or 20 minutes. “It’s discouraging,” she said. She was not alone in her frustration.

“We thought we would come and get it done early, but it’s not organized,” said Melvina Brorman, 70, who waited nearly two hours in Columbia Heights. “My knees are buckling. I suffer from arthritis.”

Others said they didn’t mind the wait, noting that the District is overwhelmingly Democratic and that they were enthusiastic about casting their ballot for Obama.

“I think if you are coming out first thing in the morning, you are willing to wait,” said Andrea Gittleman, who said she voted for Obama.

In Montgomery, the line to vote at the Silver Spring Civic Building snaked to Ellsworth Drive and east on Fenton Street to the Whole Foods, where it met shoppers rushing to stock up on groceries before the storm. Despite a wait of up to two hours, few complained.

“I was just anxious to vote for Obama-Biden,” said Opal Hyde, 81, who waited in line 90 minutes.

Others said their decision to vote on a Saturday would free up their schedule on Election Day.

“I’ve got things to do, so who knows what will happen on Election Day,” said Bibeka Lemus, 39, of Silver Spring. “I had the time today.”

Early voting continues at eight locations in the District through Nov. 3, except for Sunday. Polling sites are open from 8:30 a.m. to 7 p.m, and any registered voter can cast a ballot at any location.

Maryland’s early voting will be held each day through Thursday. Starting Monday, the locations will be open from 10 p.m. to 8 p.m.

Virginia does not have early voting open to any voter but offers absentee voting, an option only for those who cannot make it to the polls on Election Day for certain reasons, such as military service, jury duty or a long commute.