Norfolk District Attorney William Keating defeated state Sen. Robert O'Leary in the Democratic primary for Rep. Bill Delahunt's seat.

The seven-term Massachusetts Democrat announced his retirement in March.

With more than three quarters of precincts reporting, the Associated Press called the race for Keating, who had 55 percent of the vote compared to 45 percent for O'Leary.

Keating gained notoriety in the final days before the vote when he joined other diners at a restaurant in Falmouth Sunday morning in chasing a man suspected of stealing a handbag. The group of 20 or so, which included Keating, a waitress and a cook, cornered the suspect in a back yard until police arrived and arrested him, according to reports.

O'Leary, a Hyannis resident and a professor at the Massachusetts Maritime Academy in Bourne, was thought to have the geographic advantage in the 10th district, which includes Cape Cod.

But O'Leary became a target for his fellow candidates after the Boston Herald reported he was “triple-dipping” – holding two college jobs and his state Senate position. The report noted O'Leary missed 17 votes in one day because he was in class and missed 22 of the 227 roll call votes of the year. 

O'Leary defended himself to the paper, saying of his college gigs: "It's part time. I do it when the students are available and they need a teacher." He said of his voting record: "I have a voting record over my career approaching 90 percent. I rarely miss votes."

On the Republican side, state Rep. Jeffrey Perry beat out a field that included former state Treasurer Joseph Malone, accountant Ray Kasperowicz and attorney Robert Hayden.

The district went heavily for President Obama in the 2008 presidential election and is expected to be retained by Democrats in November.