Former Virginia Gov. Timothy M. Kaine, left, gestures as former U.S. Sen. George Allen listens during the Virginia Bar Association's senatorial debate at The Homestead in Hot Springs, Va. (Steve Helber/AP)

— Republican George Allen and Democrat Timothy M. Kaine went on the attack in Saturday’s lively U.S. Senate debate, signaling a change in the race as each tried to appeal to the crucial independent voters who will decide Virginia’s marquee contest.

The candidates accused each other of name-calling and ideological squabbling even as they attempted to show that they had worked with members of the opposite party — and could do so again in an increasingly partisan Washington.

Kaine blamed Allen for engaging in “smash-mouth politics,’’ such as when Allen said Republicans should knock Democrats’ “soft teeth down their whiny throats.” He then pointed to a half-dozen Republicans he had worked with, including former president George W. Bush and Gov. Robert F. McDonnell.

“I don’t think Republicans are my opponents,’’ Kaine said. “We have to compete against China and India, not against each other. That’s yesterday’s politics.’’

Allen also boasted of partnering with Democrats on welfare reform and parole abolition in Richmond as well as working with Sens. John Kerry and Hillary Rodham Clinton while serving in the Senate, but not before asking Kaine if he regretted serving as President Obama’s “hand-picked” chairman of the Democratic National Committee while the state was undergoing the worst recession since the Great Depression.

“On every single significant issue, Tim Kaine has sided with the agenda of President Obama rather than the people of Virginia,’’ Allen said.

Less than four months before voters head to the polls, the race to fill the seat of retiring Sen. James Webb (D) has emerged as one of the most competitive races in November, and one that will help determine the balance of power in the Senate. Allen and Kaine have remained deadlocked in polls for a year.

The former governors debated in front of several hundred lawyers at the posh Homestead resort, nestled in the mountains near the West Virginia border. The 75-minute debate, moderated by CNN’S Candy Crowley and sponsored by the Virginia Bar Association, was the second between Allen and Kaine but the first of the general election. It was not televised live, although excerpts will air Sunday on CNN’s “State of the Union.”

There was no gaffe by either candidate — unlike in December, when Allen seemed not to understand how birth-control pills work. Allen held his own and was less scripted than he was in his primary debates, but Kaine was quicker with statistics, often appearing like the skilled trial lawyer he used to be.

Most of the debate centered on the key issue in the race — the economy — with both men aggressively accusing each other of supporting tax hikes and increased spending as they tried to gain the upper hand.

Allen said he sided with businessmen, such as the one he met who told him government should get “off my back and out of my pockets.’’ He said he would refuse to raise taxes, even coupled with spending cuts, and instead advocated for a simpler and more fair tax code. He accused Kaine of trying to raise $4 billion in taxes as governor.

“Raising taxes will only create more job loss,’’ he said. “Raising taxes [does] not create more jobs — except at the IRS.’’

Kaine said “more revenue” as well as cuts are needed to solve the nation’s problems. He accused Allen of helping to contribute to the recent fiscal cliff by supporting increased spending and earmarks in his six years in the Senate. Kaine also faulted him for not supporting a bipartisan compromise last year to increase the debt ceiling.

“When you were in the Senate, you didn’t make cuts,’’ Kaine said. “You racheted up federal spending. You voted to increase your own pay. You voted to turn massive surpluses into deficits.’’

Unless Congress and the White House strike a deal by Jan. 2, the Pentagon will cut more than $50 billion in spending, potentially including many jobs in Virginia. Allen and other Republicans have sought to blame impending cuts on Democrats, imploring them to help approve measures to stop the cuts. A majority of Republicans in Congress and in the Virginia delegation had voted for the deal that could lead to the cuts.

Allen accused Kaine of being tied too close to Obama, a friend he has campaigned with and whose political fate is intertwined with his. The two have split on some issues, including same-sex marriage, the nation’s presence in Libya without congressional approval and the expiration of the George W. Bush-era tax cuts.

Although the president has called for allowing for the cuts to expire on all income above $250,000 per year, Kaine wants to move the bar higher, to $500,000. Allen believes that all the tax cuts, which he supported when he served in the Senate, should be extended, saying any increases could hurt a still-recovering economy.

Allen and Kaine also differ on the Supreme Court’s recent decision to uphold Obama’s health-care law.

Allen said he wants to repeal the law, but he supports those parts of it that allow children to stay on their parent’s policies and health savings accounts.

“I think that’s the way we ought to be going — where people own their own policies, make their own decisions, rather than having it be determined by insurance companies, the government or their employer,” Allen said.

Kaine supported the law when it passed and praised the court for its decision. “I think it’s foolish to keep looking in the rearview mirror,” he said.

Kaine and Allen have not agreed on any other debates yet.