A federal judge in Richmond agreed Wednesday to let three Republican presidential candidates join the lawsuit Texas Gov. Rick Perry brought after failing to qualify for Virginia’s GOP primary ballot.

U.S. District Judge John A. Gibney Jr. granted a motion to intervene brought by former senator Rick Santorum (Pa.), former House speaker Newt Gingrich (Ga.) and former Utah governor Jon Huntsman.

Rep. Michele Bachmann (R-Minn.), who also had sought to join the suit, was not included in the order. She dropped out of the race Wednesday after a last-place finish in the Iowa caucuses.

The ruling means the case against Virginia’s GOP chairman and members of the State Board of Elections would go forward even if Perry, who had a poor showing in Iowa, dropped out of the race, said Carl Tobias, a professor at the University of Richmond School of Law.

“They would keep it alive,” he said. “Once they’re parties, they step into the shoes of the plaintiff.”

Only former Massachusetts governor Mitt Romney and Rep. Ron Paul (Tex.) qualified for the March 6 ballot by collecting the required 10,000 signatures.

Virginia’s ballot-access rules are considered the toughest in the nation. But candidates who failed to meet them get no sympathy from Gov. Bob McDonnell (R).

“Heck, I did it twice. It can’t be that hard,’’ McDonnell quipped at a news conference on Capitol Square on Wednesday.

McDonnell did say that he would be open to looking at changing the ballot rules for future elections, but not the current one. McDonnell also said Perry, a friend, had not called him about his lawsuit.

“No credible candidate for statewide office in Virginia has ever had trouble making the ballot,’’ McDonnell said. “Everyone has known these rules for 40 years. We certainly don’t want to do things after the fact because the candidates didn’t make it.

“If you’re running for president of the United States, you ought to be able to get 10,000 signatures in Virginia.’’