Democrat Richard J. Davis, former mayor of Portsmouth, captured the lieutenant governorship of Virginia yesterday, riding a heavy Democratic turnout to crush Republican rival Nathan H. Miller by more than 10 percentage points.

In the race for attorney general, Democratic candidate Gerald L. Baliles defeated former Fairfax delegate Wyatt B. Durette by 27,000 votes, 51 percent to 49 percent.

Miller, a state senator from Harrisonburg, ran strong in Republican areas such as the Richmond suburbs, portions of Northern Virginia and the Shenandoah Valley. But Davis swept most of the state, gathering lopsided tallies in the central cities and Washington's inner suburbs, and winning Tidewater's Democratic strongholds by a 2 to 1 margin.

"It's better to have run and lost than never to have run at all," Miller told supporters after late returns showed him trailing Davis by 56 percent to 44 percent.

Davis, speeding by car to a Richmond victory party, said by mobile phone, "I'm, of course, elated and hope very much that the rest of the ticket does as well."

"I knew that if Marshall was behind more than four points, and with Miller losing, I would be in trouble," Durrette said. "Running in the third spot, I wasn't able to rise above the ticket." Baliles made a victory speech at 1:45 a.m.

Miller's 10-point defeat was by far the worst showing on the GOP ticket, and was attributed at least in part to conflict-of-interest charges that have been dogging his campaign for months.

Normally a low-key affair, this year's lieutenant governor's contest was rocked by controversy over disclosures that Miller had used his state Senate office to benefit his law firms's clients.

The reports -- that Miller had engineered legislation first granting electrical cooperatives $13.2 million in tax breaks and business advantages and then assisted a client's claim to potentially lucrative mineral rights -- provided the groundwork for a negatively charged campaign.

Davis suggested Miller should withdraw from the race. Miller, although a private embarrassment to the GOP's party leaders, stood firm. "I shall fight," he said. "If I have to fight them one at a time, I will. If I have to fight them all at the same time, I will."

Although Miller and Davis took similar stands on many issues, they nonetheless offered the widest division seen between candidates in any of this year's state races. Miller and Davis both supported the state's right-to-work laws and opposed collective bargaining for public employes.

But Davis, a supporter of former President Jimmy Carter and former lieutenant governor Henry Howell, favored the Equal Rights Amendment and stronger handgun rules. Miller, who opposed the ERA and all regulation of guns, frequently reminded audiences that he had backed Gov. John N. Dalton and former president Gerald Ford.

While the sole function of the $16,000-a-year post for which they were fighting is to preside over the state Senate, both acknowledged it could be a springboard to the governor's office, as it has been for the state's two previous governors.

Davis, a 60-year-old millionaire and former mayor of Portsmouth, took credit for moving Democrats to the ideological center while he was state party chairman. Soft-spoken and genial, he reminded audiences on the stump of his upbringing in a poor Irish Tidewater neighborhood. His work in rebuilding the decaying city of Portsmouth won him sympathy from blacks and blue collar workers, while his success in business stood him well with middle-class moderates and conservatives.

Davis, who served with the Marines during World War II, attacked Miller for inconsistency in his claim to having been a conscientious objector during the Vietnam conflict. Miller, a member of the Church of the Brethren, publicly changed his view after winning the party's nomination this year, saying he would no longer refuse to fight in a war.

Miller, a 38-year-old Harrisonburg bachelor with finely chiseled good looks, had emerged from relative obscurity in the state legislature to make a wild card bid for his party's nomination, winning it over the heads of GOP leaders in a divisive convention battle. A man of simple country origins, he saw no problem with "wearing two hats" as a lawyer and as a part-time legislator. He argued that although his contested legislative activities may have shown poor judgment, he had done nothing wrong.

Miller emphasized his roots in Virginia's conservative tradition while accusing Davis of supporting liberal Democrats in the past and donning conservative garb in order to win. Portraying himself as the victim of mudslinging, Miller contrasted Davis' age to his own "youthful energy" and accused Davis of championing tax increases, gun control and moving shipyard business from Newport News to Philadelphia. Davis retaliated with charges that Miller was distorting his record on those and other issues.

The lack of interest in the attorney general's race frustrated both Durrette and Baliles. After six months of campaigning, fully 50 percent of the electorate still was undecided six weeks from Election Day.

Durrette, a lawyer and former state delegate from Fairfax County, had lost a bloody convention bid for the same office four years ago to J. Marshall Coleman, who became the first Republican state attorney general in this century. Although this year's race generated little excitement, it too was viewed as possibly positioning him as the party's choice for governor in 1985.

A favorite of party leaders and some conservatives who supported Democrat Charles S. Robb for governor, Durrette, 42, emerged in 1976 as an early champion of Ronald Reagan. He was regarded as an articulate legislator, wise to the ways of media campaigning.

For Baliles, 41, a state delegate and former deputy state attorney general, the mantle of Democratic conservativism fit as well as his dark gray suits. Regarded as an underdog, he campaigned hard in Northern Virginia, trying to recapture moderate voters lost by Edward E. Lane, a former segregationist who had been the Democratic nominee four years before.

Baliles and Durrette both advocated mandatory prison sentences for many crimes. Both spoke of the need for tougher bail laws and more money for prisons. Baliles attempted to paint his opponent as inconsistent because he once supported legislation that would have allowed public employe groups to "meet and confer" with local government officials -- a measure that Baliles viewed as a step toward collective bargaining. And he joined other Democrats in the conflict-of-interest rhetoric, arguing that Durette should return campaign contributions from a Northern Virginia highway commissioner forced to resign. Durrette did.