Washington Attorney General Bob Ferguson briefly had two unexpected challengers in the state's gubernatorial primary: Bob Ferguson and Bob Ferguson.

But by Monday evening, both of the lesser-known Bob Fergusons had withdrawn from the race, fearing prosecution.

The saga began on Friday when both rival Bobs entered the governor's race as Democrats, just before the filing deadline. They joined an already crowded field — 30 people filed to run for governor last week in Washington, according to the Secretary of State's website. The filing fee costs nearly $2,000.

Washington has an open primary on Aug. 6. The top two candidates advance to the general election, regardless of their party.

bob ferguson washington attorney general

Washington's attorney general was briefly one of three Bob Fergusons running for governor in the state's open primary. Two more Bob Fergusons entered the race on Friday at the end of Washington's filing period, but withdrew by Monday evening after the attorney general said they could face criminal charges. (Chona Kasinger/Bloomberg via Getty Images)

WEST COAST EXODUS DRIVES SURPRISING POLITICAL EFFECT IN RED STATE, AND IT'S NOT A LIBERAL SHIFT

Conservative activist Glen Morgan took credit for recruiting the same-named candidates and wrote on Facebook that the two Bobs are "superior in every way to the AG running for the same office, and I believe they can provide better choices for the Democrats in our state for that office."

The other Bobs are a retired state employee from Yakima and a military veteran from Graham, The Seattle Times reported.

"If I had started a little bit earlier, I would have been able to have six Bob Fergusons," Morgan said, according to the Times. "I contacted about 12. I just ran out of time."

Ferguson — the one who is currently attorney general — was unamused, writing Saturday that the intent is clearly to "confuse voters and diminish votes."

"This is a direct attack on our democracy and the integrity of the Washington state election system that could lead to the victory of an anti-choice conservative like Dave Reichert," he wrote on X.

In a press conference Monday, the attorney general warned that the other Bobs could face criminal charges if they didn't drop out of the race by the 5 p.m. withdrawal deadline.

It's a felony under Washington law for someone to file for office with a last name "similar to one who has already filed for the same office, and whose political reputation is widely known, with intent to confuse and mislead the electors by capitalizing on the public reputation of the candidate who had previously filed."

Washington State Capitol

The top two gubernatorial candidates from Washington's Aug. 6 primary will advance to the general election, regardless of their party affiliation. The deep blue state has not elected a Republican as governor since 1980. (David Ryder/Getty Images)

SEATTLE-AREA OFFICIALS WANT 'NO LOCKS, NO CELLS' FOR JUVENILE OFFENDERS AMID RISE IN TEEN CRIME

"I suspect they did not know about the legal implications of their actions," Ferguson said, adding that cease-and-desist letters were left at the other Bobs homes on Sunday and that he hoped they would recognize the seriousness of the situation and drop out.

If they don't, the attorney general said, "We will have no choice but to take more serious steps and ask local prosecutors to do the right thing and pursue further action."

By Monday evening, both Bobs were out of the race. The Bob Ferguson from Graham shared a statement saying that he was withdrawing "under duress."

"I was publicly labeled a ‘threat to democracy’ by another candidate and his supporters," he wrote. "In a typical hypocritical fashion, this other candidate’s actions are the true threat to democracy. I believe this shows that the other candidate fears he has not effectively done enough to stand out, or that he thinks voters are not competent enough to think for themselves."

Attorney General Ferguson celebrated the win Monday night.

"We defeated their dirty tricks," he wrote. "You won’t have to worry about which ‘Bob Ferguson’ to vote for. This blatant attack on election integrity failed, and democracy wins."

‘FOCUS ON MERIT’: OREGON COUNTY AXES DIVERSITY OFFICE THAT COST NEARLY $1 MILLION A YEAR

During the press conference, Ferguson did not specifically say whether Morgan himself could face charges for orchestrating the "scheme."

"We will cross that bridge when we get to it," Ferguson said.

Morgan did not address the possibility of civil or criminal penalties when asked for comment via email, but wrote that the attorney general "has always been angry and upset" with him for filing a campaign finance complaint against Ferguson.

Whoever wins the governor's race will replace Democrat Jay Inslee, who has led the state since 2013.

Washington Gov. Jay Inslee stands next to Attorney General Bob Ferguson

Washington Gov. Jay Inslee previously endorsed Attorney General Bob Ferguson to succeed him as governor. (Jason Redmond/AFP via Getty Images)

CLICK HERE TO GET THE FOX NEWS APP

The Republican side of the race has been mired in drama as well. Last month, both leading candidates were initially disqualified from receiving the state's GOP endorsement, The Olympian reported.

Semi Bird, a former school board member, was disqualified for his failure to disclose a misdemeanor grand larceny charge from 1993. Dave Reichert, a former congressman and detective credited with nabbing the infamous Green River killer, was disqualified as a result of a "disparity in the vetting of the governor candidates," the outlet reported.

Delegates overruled the disqualification and 72% endorsed Bird, who has raised only $400,000 compared to Reichert's $2.6 million.