CONCORD, N.H. (AP) _ Endicott Peabody, whose 30-year political career in Massachusetts included a stint as governor, got a taste of victory in New Hampshire by winning the Democratic primary for the U.S. Senate.

Peabody, coaxed out of retirement by the Democratic Party after a Lyndon LaRouche supporter got on the ballot, easily defeated two other candidates Tuesday for the right to face GOP Sen. Warren Rudman in November.

Rudman, the 56-year-old co-author of the Gramm-Rudman budget-reduction law, had no primary opposition because of a state Ballot Law Commission ruling that forced former Pentagon ''Star Wars'' spokesman Bruce Valley, 42, of Rye, to run as an independent in November.

In a rerun of the 1984 gubernatorial battle, Republican Gov. John Sununu, an ardent Seabrook nuclear plant supporter, will be pitted against Democrat Paul McEachern, who vows to kill the project.

Peabody, 66, won 19,378 votes for 63 percent with 274 of 298 precincts reporting. Robert Dupay of Nashua had 5,551, 18 percent; LaRouche supporter Robert Patton had 3,459 votes, or 11 percent; and Andrew Tempelman of Milford, 2,412 votes, or 8 percent.

Sununu, 47, of Salem, took credit for erasing a state budget deficit and fostering the lowest jobless rate in the nation.

With 281 of 298 precincts reporting in the GOP gubernatorial primary, Sununu had 41,649 votes, or 77 percent, to 12,517 votes, or 23 percent, tallied by Rep. Roger Easton.

''The Democrats have decided to run a one-note campaign.... There is no question that the issue of energy, the issue of Seabrook must be addressed, but it has to be addressed in perspective,'' Sununu said.

McEachern won 18,623 votes, or 56 percent, while Paul Gagnon of Manchester had 9,041 votes, or 27 percent, and Bruce Anderson of Harrisville had 5,530, or 17 percent.