Judge Hollis McGehee sided with Cochran's legal team. They had asked McGehee to dismiss the case because McDaniel did not file it within the period designated under Mississippi law.
McDaniel is expected to appeal the decision to the state Supreme Court, but did not immediately announce plans to do so.
According to the Clarion Ledger newspaper of Jackson, Miss., "McDaniel lawyer Mitch Tyner said that McDaniel wants to mull things over the weekend before deciding whether to appeal McGehee's ruling. He said McDaniel will announce his decision at a press conference on Tuesday."
McDaniel, a state senator, narrowly defeated Cochran in the June 3 GOP Senate primary. But Cochran turned the table two weeks later, and surprised prognosticators by beating McDaniel in the runoff. Cochran did so partly by garnering the support of self-identified Democrats who did not participate in the June 3 primary.
Mississippi doesn't register voters by party, and under state law, any voter can support a candidate in a primary runoff contest as long as they did not vote for another party's standard bearer in the first round of voting.