Associated Press
Republican presidential candidate former Utah Gov. Jon Huntsman accompanied by his wife Mary Kaye Huntsman, and Don Welch president and CEO of Globe Manufacturing campaigns at Globe Manufacturing, Wednesday, Jan. 4, 2012, in Pittsfield, N.H.

RICHMOND, Va. — A federal judge on Wednesday allowed three Republican presidential hopefuls to join Texas Gov. Rick Perry's lawsuit challenging Virginia's ballot access law.

U.S. District Judge John A. Gibney Jr. granted a motion by former House Speaker Newt Gingrich, former Utah Gov. Jon Huntsman and former Pennsylvania Sen. Rick Santorum to intervene in the lawsuit.

Perry filed the lawsuit last month after failing to obtain enough signatures of registered voters to get on Virginia's GOP presidential primary ballot. Gingrich also failed to qualify, leaving former Massachusetts Gov. Mitt Romney and Texas Rep. Ron Paul as the only candidates who will appear on the ballot for Virginia's March 6 presidential primary. Santorum did not submit enough signatures to be considered, according to court papers, and Huntsman did not submit any petitions.

Virginia requires candidates to submit the signatures of at least 10,000 registered voters, including at least 400 from each of the state's 11 congressional districts, to be placed on the ballot. Perry submitted about 6,000 signatures by the Dec. 22 deadline.

Perry maintains that Virginia's requirements are unconstitutional because they violate his freedoms of speech and association. He also challenges the part of Virginia's law that says signatures must be gathered by a state resident, claiming that the requirements "restrict the number of message carriers" and even prevents him from soliciting signatures for his own campaign.

In court papers, Gingrich, Huntsman and Santorum said they should be allowed to join the suit because if the court orders Romney's name placed on the ballot, their interests in participating in the primary "would be substantially impaired due to denial of their access to the ballot under the same burdensome petition signature requirements" challenged in the lawsuit.

A hearing on Perry's request for a preliminary injunction is set for Jan. 13.

Perry told supporters after his fifth-place finish in Iowa's caucuses that he was reconsidering his campaign. But Wednesday he announced via Twitter that he was still in the running and planned to compete in South Carolina's primary this month.

Virginia's stringent ballot access requirements have drawn criticism from several officials, including Republican Attorney General Kenneth Cuccinelli, whose office represents state elections officials who are named as defendants in the lawsuit. Cuccinelli said in court papers Tuesday that his public statements about his public policy concerns do not affect his ability to defend the constitutionality of the law.

Other officials have said candidates knew well in advance what they had to do to qualify for the ballot.

"Heck, I did it twice, it can't be that hard," Republican Gov. Bob McDonnell told reporters Wednesday.

The Republican governor acknowledged that Virginia has strict guidelines to get on a primary ballot, but added: "If you want to be president of the United States, you ought to be able to get 10,000 signatures in Virginia."

Associated Press writer Michael Felberbaum contributed to this report.