U.S. Sen. Richard Lugar will switch his voter registration to his family farm in Indiana to resolve a dispute with election officials who ruled he couldn't vote using the address of an Indianapolis home he sold in 1977.

The resolution that Lugar's lawyers reached Friday with elections board headed off a court hearing on a challenge from Lugar, who lives in Virginia. The judge dismissed the case after lawyers agreed Lugar could legally vote from the farm in Marion County that has been in his family for more than 80 years.

Lugar is facing one of his toughest election battles in the Republican primary against state Treasurer Richard Mourdock. Lugar has received criticism for his decision not to keep a home in Indiana while serving in the Senate.