In a strip mall in downtown Rockville, a haggard and unshaved young man named Vivek Chopra girded yesterday for battle.

His troops: more than 1,800 volunteers ready to dial telephones, knock on doors and "flush" Democratic voters from their homes. His weapons: a dozen phone banks, thousands of leaflets and 10,000 videotapes featuring a last-minute appeal from Democrat Kathleen Kennedy Townsend to undecided female voters.

The prize: Montgomery County, the largest jurisdiction in Maryland and a critical battleground for both candidates in the state's fiercely contested race for governor. After five months of speeches and millions of dollars worth of TV ads, the race between Townsend (D) and Rep. Robert L. Ehrlich Jr. (R) is tied, and the outcome depends on how well field directors such as Chopra herd each candidate's supporters to the polls.

"It's like organizing six weddings," Chopra said as he prepared to send the first of three sets of door-knockers out yesterday to swing precincts in Montgomery. "This is an army."

With the election Tuesday, Ehrlich, Townsend and their partisans across the state are pressing one of the most costly and ambitious drives to turn out voters Maryland has seen. Hundreds of thousands of homes are being bombarded by prerecorded phone calls from President Bush (R) and former president Bill Clinton (D). Some voters are even hearing from Ehrlich's mother, Nancy, whose recorded voice urges them to "vote for my son."

Republicans are making an unprecedented push to increase voter turnout in the Baltimore suburbs and other areas where Ehrlich has racked up huge leads, party officials said. They have mailed sample ballots to nearly 800,000 Republican and independent households, and they have launched a sophisticated get-out-the-vote operation to challenge Townsend in the vote-rich Washington suburbs.

Turnout is most crucial for Townsend. Polls show that Ehrlich's supporters tend to be hard-core voters who will cast ballots no matter what. Townsend, like most Democrats, does better among people who are less certain to vote.

So, on Election Day, Democrats must rally as many people as possible to the polls. Their plan involves more than 10,000 volunteers focused on boosting turnout in Montgomery and Prince George's counties, Baltimore and other pockets of Democratic strength.

"Polls can't gauge turnout," said Karen White, the Democrats' statewide field director. "If it comes down to turnout, there's no question in my mind that we win."

While Republicans can't match the scale of the Democratic operation, they have enthusiasm on their side, said Wayne Clarke, Ehrlich's campaign coordinator in Prince George's. "Our voters are excited about coming out to vote for Ehrlich-Steele," Clarke said, referring to Ehrlich's ticket-mate, Michael S. Steele. "The reason the Democratic Party has to try every trick in the book is because there's a lack of enthusiasm for Kathleen Kennedy Townsend."

Ehrlich, 44, a four-term congressman from suburban Baltimore, would be the first Republican elected governor of Maryland in 36 years. Townsend, 51, the state's first female lieutenant governor, would be the first woman to ascend to its governor's mansion.

The contest is one of the nation's closest and marks the third time in a row that the race for governor in Maryland has been a nail-biter up to Election Day, despite a nearly 2-to-1 advantage for Democrats among registered voters.

In January, Townsend had a double-digit lead in the polls and was expected to coast to victory on the strength of her famous name -- she is the eldest child of Robert F. Kennedy -- and her prodigious fundraising ability. But Ehrlich has raised more money and battled her to a draw by winning over a majority of independent voters and as many as one in five Democrats, polls show.

Political analysts say the close contest reflects a deep divide among Maryland Democrats. While the party includes a huge number of African Americans and old-fashioned liberals, it is also home to many conservative and "swing" Democrats who are willing to support a fiscally conservative Republican in statewide races.

"The bottom line is you've got an electorate that's much more even in policy preferences than it is in partisanship," said James G. Gimpel, a political science professor at the University of Maryland in College Park. "People are disregarding party labels in favor of other considerations."

When the campaign began this spring, both candidates tried to position themselves to appeal to swing voters. Ehrlich persuaded the Christian conservatives, abortion opponents and gun enthusiasts who dominate his party that they could win only by running a moderate campaign. That freed him to choose an African American running mate, former GOP state chairman Steele, and make a play for votes from blacks, who make up more than 27 percent of the state population.

Townsend assumed that her family name and the liberal legacy of Gov. Parris N. Glendening (D) would keep black voters in her corner. She chose a white, lifelong Republican as her running mate, retired Adm. Charles R. Larson. The selection infuriated black leaders, who had hoped that Townsend would choose a black running mate, and forced Townsend to spend much of the campaign trying to make amends.

In the final days, Townsend's get-out-the-vote effort is relying heavily on traditional liberal interest groups, including gun-control advocates, health care activists, environmentalists and labor unions. Unions, in particular, have brought hundreds of volunteers to the campaign and offered Townsend use of a big purple bus wired to allow 12 volunteers to call 2,000 voters an hour.

But black turnout remains critical to Townsend's bid. Black voters are the party's most loyal constituency, and Democrats are focusing enormous energy on making sure that voters in Prince George's, Baltimore and smaller black communities across the state get out and vote.

In Baltimore, 500 volunteers for an influential nonprofit group will distribute candidate scorecards to voters in 75 black precincts. Last night in Prince George's, Democratic state senators hosted "bag parties," where volunteers picked up sacks of sample ballots for distribution to independent and Democratic households.

On the Eastern Shore, where the black population is large enough to warrant its own state delegate district, the Talbot County NAACP is conducting a massive campaign to reach voters through mailings, radio ads and a "gospelfest" rally.

Ehrlich, too, is making a bid for black votes, particularly in Prince George's, Steele's home base. The county is home to a large number of affluent African Americans whom Republicans hope will be receptive to Ehrlich's message.

Clarke said he is targeting "discontented" black Democrats in older communities, mostly outside the Capital Beltway. GOP volunteers are knocking on doors and distributing fliers that "inform the community that the Democratic Party turned their back on the African American community when they had an opportunity to put an African American on the ticket," Clarke said.

Clarke's operation marks a departure for Maryland Republicans, who have in the past relied heavily on volunteer phone banks and grass-roots groups such as Christian conservatives to push supporters to the polls.

"Republicans don't turn out their vote through organization. They do it through message," said John McDonough, counsel to the Prince George's Democratic Party. "The tricky thing for them right now is they're running a [moderate] campaign that is the opposite of what motivates their base."

In Frederick County, leaders of the state's largest Christian Coalition said they're doing nothing on Ehrlich's behalf. Gun groups, too, are lying low in a calculated strategy to deprive Townsend of fodder for her claims that Ehrlich is a pro-gun "extremist."

Maryland's largest antiabortion organization also did not endorse Ehrlich, who is campaigning as a "pro-choice" candidate. But the group has sent a mailing to about a third of its 200,000 supporters reminding them that Ehrlich is "80 percent pro-life," said the group's president, Angela Martin.

While their core constituencies are subdued, Republicans say they're making up for it with a $250,000 plan to motivate voters in areas of the state where Republican candidates have done well, including the Baltimore suburbs, Western Maryland and the Eastern Shore.

"If you look at the map from 1998, a lot of our strong areas didn't turn out as well as they should have," said Paul Ellington, the state GOP executive director.

This year, Republicans will have a band of volunteers tracking turnout on Election Day as Democrats do, Ellington said. And if turnout is low in, for example, Cecil County, Ellington said, Republican volunteers will be mobilized to contact voters and get them to the polls.

Republicans also have mailed absentee ballots applications to hundreds of thousands of GOP households. State officials say applications are up by nearly 20,000 from 1998, but they could not tell whether either party has an edge.

Ellington said Ehrlich is likely to benefit from high turnout in conservative areas that have unusually competitive local races this year. In the Democratic strongholds of Baltimore and Prince George's, local races are mostly decided, which could depress turnout.

Townsend could benefit from a hot congressional race in Montgomery that pits incumbent Rep. Constance A. Morella against Democrat Christopher Van Hollen.

Yesterday, Ehrlich paraded with supporters along a leafy street near Olney, while Townsend addressed about 60 people at the Kentlands, an upscale development that has emerged as a key swing precinct.

Republicans are hitting the area with signs and leaflets, while Democrats have dispatched phalanxes of door-knockers. Some residents complain about receiving "robo calls" from Townsend herself.

The target: people such as John Keenan, 39, a tax lawyer and registered Democrat who described himself as undecided.

Ehrlich "hasn't done anything impressive in Congress," Keenan said. But Townsend and Glendening have failed to relieve traffic gridlock.

"I'll tell you what's going to happen," Keenan said. "I'm going to see what happens over the next few days. I won't hear anything that impresses me from either side, and I'll probably end up voting for Ehrlich, just for a change."

Staff writers Nurith C. Aizenman and Amy Argetsinger contributed to this report.

Rep. Robert L. Ehrlich Jr. (R) meets potential supporters in Rockville in the tight race for Maryland governor.Lt. Gov. Kathleen Kennedy Townsend (D) attends a campaign rally with Sen. Paul S. Sarbanes (D) in Gaithersburg.