Former Virginia Gov. Tim Kaine, left, and former senator and governor George Allen greet each other after the AP Day at the Capitol Senatorial debate in Richmond on Dec. 7. (Steve Helber/AP)

Two former Virginia governors battling in one of the most competitive U.S. Senate races in 2012 clashed over the nation’s troubled economy Wednesday in their first debate.

Republican George Allen and Democrat Timothy M. Kaine engaged in a series of feisty exchanges during the 90-minute matchup that covered a variety of issues — including abortion, energy independence and their records as governor.

The race, one of a handful that could determine control of the Senate, took place in a swing state critical to President Obama’s reelection hopes.

The president’s name came up countless times during the debate. Although some Democrats have tried to distance themselves from Obama, Kaine has not. Urged by Obama to run, Kaine noted several times that the president had saved the U.S. auto industry and taken down Osama bin Laden.

“Both candidates realize the national dynamic is going to play a big role in the Senate race this year,” said Mark Rozell, a George Mason University political scientist. “George Allen will continue to try to tie Tim Kaine to the Obama administration, which from Allen’s standpoint is good politics given the low approval ratings.”

Allen tried to paint Kaine, a former chairman of the Democratic National Committee, as a liberal who has embraced tax increases and sided with Obama on the economic stimulus and health-care overhaul. He referred to Kaine’s “national partisan role advocating for the likes of not only President Obama’s policies but those of [House Democratic leader] Nancy Pelosi . . .

“The ‘likes of President Obama’?” Kaine broke in.

Kaine accused Allen of not following through on promised spending cuts while governor and senator — the same accusations his more conservative tea party rivals have made.

“Compare my record with a senator who turned the biggest surplus in the history of the United States into the biggest deficit,” Kaine said.

The former governors, in a dead heat according to recent polls, debated at the Associated Press Day at the Capitol, an annual event sponsored by the Virginia Associated Managing Editors and the Virginia Capitol Correspondents Association.

The debate was a lively exchange between two political veterans who aggressively attacked each other and repeatedly interrupted each other even as they lamented Washington’s toxic tone.

Both men, vying to replace retiring Sen. James Webb (D), mostly smiled throughout, although at times the smiles were strained. Kaine appeared more relaxed and his campaign far more aggressive — sending out a flurry of e-mails and tweets during the debate, while Allen’s remained characteristically quiet.

In an apparent gaffe, Allen seemed not to understand how birth-control pills work or the full impact of a “personhood amendment” he is promoting. The bill would not outlaw the pill, Allen said, because it prevents contraception from taking place.

“How do you think birth-control pills and intrauterine devices work?” asked one of the questioners.

Allen noted that he is not a doctor but that relying on what he knew and “maybe a little bit of Latin,” he said he understood “contraception” to mean something that prevents conception.

Kaine jumped in: “Modern birth-control pills have a double mechanism either to stop fertilization or stop [a fertilized egg] from implanting. IUDs stop a fertilized egg from implanting.”

Afterward, Allen was asked by reporters if he misspoke about the personhood amendment. “As I understand it, whether it’s the Virginia one or the federal one, neither would prohibit contraceptives. I would not be for banning contraceptives.”

Allen repeatedly attacked Kaine for backing the Obama administration’s energy policies, which he said were stifling jobs in Virginia and across the country. Allen stressed his support for offshore oil drilling.

Kaine, for his part, called for an “all of the above” strategy that utilizes new energy sources as well as oil and coal. He suggested that Allen was too close to traditional energy industries — voting for subsidies for “Big Oil” — to be open to alternatives.

“We can’t have oil-covered glasses and look at everything that way,” Kaine said.

Early in the debate, both candidates tackled a question on the incident that helped sink Allen’s 2006 Senate reelection campaign: his reference to an Indian American Democratic campaign volunteer as “Macaca.”

Allen reiterated that he regretted the incident, then quickly steered the topic to energy policy and high gas prices.

Kaine said the slur remains relevant. “I don’t know that there’s anybody in this room who thinks that the way to fix the dysfunction in Congress is to put more people in who want to do name-calling, who want to divide people against one another,” Kaine said.

Allen and Kaine are not the only candidates in the race, but the other six did not meet qualifications based on polling and fundraising.

Staff writer Ben Pershing contributed to this report.