Assistant District Attorney Thomas P. Brown of Cuba beat acting County Judge Judith E. Samber of Alfred on Tuesday for the Republican nomination to run for judgeship.
Brown received 3,408 votes to Samber's 2,261.
In Legislative District 4, an incumbent and a retired deputy sheriff won Republican nominations to run in November.
Legislator James A. Graffrath, R-Andover, took 597 votes Tuesday, with Robert K. Sobeck of Wellsville, a retired deputy and a Wellsville Town Board member, taking 710.
Legislator John W. Walchli Jr., R-Wellsville, had 536 votes, to 542 for Daniel Russo, a Wellsville Town Board member. Steve Mosher of Wellsville received 483 votes. The Board of Elections has 73 absentee ballots to count in the district.
The winners of the Republican primary will face Democrats D. Paul Servey and Barbara Hetzel, both of Wellsville, in November. The district elects three legislators.
Walchli has said he would run on the Conservative line if he lost in the primary.
Meanwhile, Samber, who was appointed in the spring to replace retired Judge Wayne A. Feeman, offered "hearty congratulations" to Brown.
Samber said she wanted to thank those who helped in her campaign.
Samber said she will finish her term as judge Dec. 31 but has not made plans for the future.