Democratic Sen. R. Creigh Deeds and Republican Del. Robert F. "Bob" McDonnell were virtually tied in the race for Virginia attorney general, and both campaigns said the race was too close to call.

Peter Jackson, Deeds's communications director, said last night that Deeds was awaiting the tallying of final votes as well as absentee ballots. "At the end of the day, all the votes have to be counted," Jackson said. "I'm sure Delegate McDonnell joins Senator Deeds in demanding that every vote is counted."

John Phillippe, McDonnell's spokesman, said the candidate would wait for final results. "It's so close that there will likely be a recount," he said.

Under Virginia law, the loser may request a recount but not until the state Board of Elections certifies the results Nov. 28. If the winner's lead is less than one-half of one percent, the state will pay for the recount, election officials said.

But why, with clear winners for both governor and lieutenant governor, was this race so close?

Toni-Michelle Travis, an associate professor of government and politics at George Mason University, said last night that the tight race might be attributed to the exposure both candidates have had outside Northern Virginia during years of public service.

"Creigh Deeds has a wide name recognition in parts of Virginia, and McDonnell does too," Travis said. "They are both well-known throughout the nonurban areas."

Voters in many jurisdictions split their ballots. In several locations, voters selected Democrat Timothy M. Kaine for governor but voted for McDonnell for attorney general. In Bath County, however, where Deeds was a prosecutor, voters favored Republican Jerry W. Kilgore but cast more ballots for Deeds.

Larry J. Sabato, director of the Center for Politics at the University of Virginia, said last night that the Deeds campaign was bolstered by the popularity of Democratic Gov. Mark R. Warner, and governor-elect Kaine. "A lot of this was coattails," Sabato said. But he said the final outcome remained uncertain. "Maybe there will be a recount. Who knows?" Sabato said.

Deeds (Bath), 47, and McDonnell (Virginia Beach), 51, who both made public safety reform a campaign centerpiece, are former prosecutors. Each also has spent 14 years in the Virginia General Assembly, and, in campaign stops, each stressed his work as a lawmaker on criminal justice issues.

McDonnell, a retired Army officer, was an assistant prosecutor in Virginia Beach before he was elected to the House in 1991. He has sponsored legislation to toughen penalties for drunk drivers and pushed for increased compensation for crime victims.

In his campaign for attorney general, McDonnell has made reform of sexual predator laws a key focus, saying he would push for 25-year mandatory sentences for people convicted of sexually assaulting children. He says a second offense should be punished with a life sentence, and he wants released sex offenders' movements monitored using Global Positioning System tracking.

Deeds, who was commonwealth's attorney in rural Bath County for four years, served 10 years in the House and four in the Senate when he was elected to fill the seat of Emily Couric of Charlottesville after she died in office. He sponsored measures that created Virginia's versions of the Amber Alert system, used to help find missing children, and Megan's Law, which tracks released sex offenders.

One of Deeds's most high-profile proposals was a 2001 constitutional amendment guaranteeing a right to hunt and fish, an effort that helped him secure the endorsement of the National Rifle Association in the attorney general's race.

Although public safety issues dominated the early race, in recent weeks both candidates have campaigned with the intent of using social issues to energize core supporters from their respective parties, said Joshua G. Behr, an assistant professor of political science at Old Dominion University.

In recent days, the Deeds campaign ran a television advertisement in Northern Virginia that emphasized McDonnell's ties to evangelist Pat Robertson, who gave $36,000 to McDonnell's campaign. McDonnell earned his law degree at Regent University in Virginia Beach, which was founded by Robertson in 1978.

The spot also emphasized McDonnell's antiabortion stance.

McDonnell, responding in statements to reporters, called Deeds "religiously intolerant" and described the television spot as an "attack on Christians across Virginia." McDonnell's campaign went on to describe what it called Deeds's "liberal record" and note that he was endorsed by NARAL Pro-Choice Virginia.

Yesterday morning, Shakuntala Ghare, 71, of Fairfax, an associate professor at Northern Virginia Community College, said her views on abortion caused her to cast a vote for Deeds. "I thought Deeds was more pro-choice for women," she said.

Dan Harris, 71, of the Leisure World retirement community, said he was thinking about safety when he supported McDonnell, whom he sees as tougher on criminals.

Staff writer Rosalind S. Helderman contributed to this report.

With son Bobby behind him, Republican Del. Robert F. "Bob" McDonnell, left, talks to supporters. At right, Democratic Sen. R. Creigh Deeds is surrounded by well-wishers.