Tim Kaine, the former Democratic governor of Virginia, has the lead in his race to join the Senate, despite a torrent of negative advertising from third-party groups on behalf of his Republican rival, George Allen, the state’s former senator.

Mr. Kaine holds a seven-point lead over Mr. Allen, according to a survey of likely voters by Quinnipiac University, The New York Times and CBS News. The poll shows Mr. Kaine with 51 percent to Mr. Allen’s 44 percent, beyond the poll’s margin of sampling error of plus or minus three percentage points. A separate poll in Virginia by NBC News, The Wall Street Journal and Marist has the race essentially tied with Mr. Kaine only one percentage point ahead.

The race is one of the marquee Senate battles in the nation and the outcome will help decide whether Democrats maintain control of the Senate.

Mr. Kaine, who also served for two years as President Obama’s choice to head the Democratic National Committee, is matching Mr. Obama’s performance in the commonwealth. The same survey shows the president at 51 percent, five points ahead of Mitt Romney, the Republican nominee for president.

Crossroads GPS, a conservative group, has been advertising against Mr. Kaine for weeks. The latest ad hits Mr. Kaine for supporting a Congressional deficit deal that threatens deep defense cuts if lawmakers do not reach an agreement to avoid them.

“Tim Kaine supported the Washington budget deal, a deal that could destroy over 500,000 jobs in the defense industry,” the ad says. “Tim Kaine didn’t put Virginia first, so, Virginia, don’t put Tim Kaine in the Senate.”

But Mr. Kaine’s direct-to-camera ads comparing his record to that of Mr. Allen appear to be working. He is leading in the state even as voters there give high marks to the state’s current Republican governor, Bob McDonnell. Fifty-two percent of voters said they approve of the way Mr. McDonnell is handling his job as governor.

The matchup between Mr. Kaine and Mr. Allen pits two of the state’s most experienced politicians against each other. Both men served as governor in the past. Mr. Allen had served one term in the Senate starting in 2000, but was defeated in 2006 by Senator Jim Webb, who decided to retire this year.

Mr. Webb’s decision cleared the way for Mr. Kaine, who would join fellow Senator Mark R. Warner, another Democrat, if he wins in November.

Strategists for Mr. Allen and Mr. Kaine have both said they think the race is likely to be affected by the clash between the president and Mr. Romney. Mr. Obama’s current success in the state may be helping to lift Mr. Kaine’s Senate bid.

But in the end, both races could come down to efforts to turn out voters in the state’s different population centers.

Mr. Allen’s campaign, like most Republicans, is targeting conservative voters in the state’s rural areas, the military communities around Virginia Beach, and the Republican exurbs. Mr. Kaine is counting on the massive population center in Northern Virginia, African-Americans and the state’s rapidly-growing Hispanic communities.