Keating said he was happy with his win, but not taking anything for granted in November.
"We're shifting right into gear. We're back to work on Monday. It's all centered on moving the economy forward," he said.
Republicans Christopher Sheldon of Plymouth and Adam Chaprales of Barnstable were locked in a close race in the 9th District, which includes Cape Cod and much of the South Shore. The winner will face Keating.
U.S. Rep. Richard Neal, of Springfield, appeared headed for a 13th term in the House after defeating two challengers in the redrawn 1st District encompassing much of western Massachusetts. There are no Republicans running in the district.
Neal represents the current 2nd District. Democratic U.S. Rep. John Olver, who has represented the current 1st District since 1991, is retiring at the end of this term.
U.S. Rep. James McGovern, of Worcester, the other only incumbent who faced a primary challenge, easily defeated Worcester resident William Feegbeh and does not have a Republican opponent in November.
Neither candidate in what could be the most hotly contested November congressional race in Massachusetts faced primary opposition on Thursday. Incumbent Democrat John Tierney of Salem and Richard Tisei, a former state senator and the 2010 Republican nominee for lieutenant governor, have already been sparring for months in the 6th District.
Thursday's results set up several other November congressional races in Massachusetts.
— In the 3rd Congressional District, Carlisle businessman Jon Golnick defeated Tom Westford in the GOP primary to earn a rematch with incumbent Rep. Niki Tsongas, who was unopposed in the Democratic primary.
— U.S Rep. Edward Markey, the dean of the Massachusetts congressional delegation, was unopposed in the Democratic primary and will face Tom Tierney, of Framingham, who won a three-way Republican primary.
— In the 8th District, Joe Selvaggi, a Boston resident, defeated Matt Temperley of Quincy for the Republican nomination to face Democratic incumbent U.S. Rep. Stephen Lynch, who was not challenged in the primary.