If Ken Cuccinelli II loses his bid to be the next governor of Virginia on Tuesday, as polls suggest he will, the date of the Republican defeat will be traced back to May 18.

That was the day the commonwealth’s Republican Party took what had been a sure thing and instead allowed the tea party to give the Democrats an opening.

Supporters of Cuccinelli, the state attorney general, had scrapped the GOP gubernatorial primary, which probably would have resulted in the nomination of Lt. Gov. Bill Bolling, a mainstream conservative who likely would have cruised to victory.

But Cuccinelli’s supporters forced the party to cut the electorate out of the process, replacing the primary with a convention. There, a smaller number of tea party activists handed the nomination to Cuccinelli, a man so conservative he had supported legislation that would have allowed the banning of the pill and other forms of birth control.

Unfortunately for Republicans, the convention chose not just Cuccinelli but also, as the lieutenant governor nominee, E.W. Jackson, a man who has said that gays are “very sick people” whose “minds are perverted”; who has argued that Planned Parenthood has been worse for blacks than the Ku Klux Klan; and who has also said that non-Christians practice “some sort of false religion.”

Suddenly, Democrats were in contention.

The off-year elections in Virginia and New Jersey have, in the past, been national bellwethers, measuring the sentiment of the electorate. This year, there are no clear national trends in either election, but the pattern in Virginia and New Jersey does suggest a pivotal moment in the Republican Party: the moment the tea party jumped the shark.

In New Jersey’s gubernatorial race, highly popular incumbent Chris Christie, who conspicuously spurned the tea party wing, is cruising to reelection. In Virginia, a seat that should be safely Republican has been put in jeopardy.

The tea party has caused Republicans to lose other races in recent cycles, including Senate contests in Delaware, Nevada, Indiana and Colorado. But the Virginia race, following a federal government shutdown forced by the tea party, could finally provide some impetus for what remains of mainstream Republicans to reclaim their primaries.

The tea party has been in steep decline from its 2010 peak, but it retains power where it matters: in the ability to force the nomination of far-right candidates and to defeat Republican officeholders who aren’t sufficiently extreme. The primary process is the sole source of power for the tea party, but it has become a stranglehold.

Certainly, Cuccinelli has problems that aren’t related to the tea party: the gifts scandal surrounding Gov. Bob McDonnell, the fundraising advantage enjoyed by Democrat Terry McAuliffe and Virginia’s overall shift toward Democrats driven by growth in the Washington suburbs.

But pretty much everything else that has gone wrong for Cuccinelli can be attributed to the tea party. Republicans were up against a weak Democrat in a strong year (in the past nine gubernatorial elections, Virginians chose the party that didn’t control the White House), but they tossed away their advantage.

I’ve known McAuliffe for almost 20 years, and I admire his boundless enthusiasm. But he shouldn’t have a chance in this race. He’s a liberal from New York, a McLean millionaire, a former Democratic National Committee chairman who served as chief moneyman to Bill and Hillary Clinton. A company he led as chairman until last year, GreenTech, is under federal investigations, and he failed to disclose his investment in a Rhode Island insurance scam that used the identities of dying people.

On May 9, the Daily Beast published an article titled “How Terry McAuliffe and the Dems Lost Virginia.” It cited a Post poll showing McAuliffe trailing Cuccinelli by 10 points among the likeliest voters.

But then came a fuller examination of Cuccinelli’s positions (opposing transportation spending and immigration reform and proposing to bestow full “personhood” on fetuses), the Jackson nomination and a split in the tea party movement that allowed for the emergence of a Libertarian candidate, Robert Sarvis. Sarvis has forced Cuccinelli, in the closing days of the campaign, to shore up his conservative base by bringing in Ron Paul, a former Republican representative from Texas, and Sen. Rand Paul (R-Ky).

Finally came the government shutdown, instigated by Sen. Ted Cruz (R-Tex., from whom Cuccinelli tried to keep his distance. But in the middle of the shutdown, both men spoke at the same Family Foundation dinner in Richmond. Cuccinelli insisted that he disagreed with Cruz’s tactics, but that was hardly tenable: Cuccinelli, and the rest of the Republican ticket in Virginia, had gained their nominations because of the very movement that had elevated Cruz.

Cruz, at the dinner, declared “how proud I am of my friend Ken Cuccinelli.” It may have been the kiss of death.

Twitter: @Milbank

Read more from Dana Milbank’s archive, follow him on Twitter or subscribe to his updates on Facebook.