BOSTON -- Norfolk District Attorney William Keating and Republican State Rep. Jeff Perry will square off in November in the state's hotly contested 10th Congressional District, the only open U.S. House seat in Massachusetts. 

Keating defeated state Sen. Robert O'Leary, of Barnstable, in Tuesday's Democratic primary in the district which stretches from Quincy to Cape Cod. 

Perry, of Sandwich, defeated state Treasurer Joseph Malone and two other candidates in the GOP primary. 

Three non-party candidates will also be on the November ballot. 

U.S. Rep. William Delahunt, a Democrat, is leaving office after seven terms. 

The race is expected to be an expensive one. Republicans view the seat as being among its best opportunities in New England to pick up one of the 39 seats needed to win control of the House of Representatives.