Democratic challenger for U.S. representative Ayanna Pressly wraps up a campaign event at Diesel Cafe in Somerville’s Davis Square on Aug. 26. (Photo: Marc Levy)

In decisive races that will define the ballot for the Nov. 6 general election, there were 21,968 ballots cast in Cambridge in a primary election held Tuesday – that’s out of 67,667 registered voters, making for a 32 percent turnout, according to the city’s Election Commission. Cambridge went its own way on some races voters felt differently about statewide, including on choices for lieutenant governor and secretary of state.

The commission reported unofficial results in the primary that do not include write-in, auxiliary, overseas absentee or provisional ballots:

Governor 

Democratic: Statewide, Jay M. Gonzalez took 65 percent of the vote to Bob Massie’s 35 percent.

In Cambridge, Gonzalez took 56 percent of 18,906 ballots cast (10,590) to Massie’s 43 percent (8,151).

Republican: Statewide, incumbent Gov. Charles D. Baker took 64 percent of the vote to challenger Scott D. Lively’s 36 percent.

In Cambridge, Baker took 75 percent of 925 ballots cast (692) to Lively’s 25 percent (232).

Democratic challenger Gonzalez will face Republican incumbent Baker in a general election.

Lieutenant Governor 

Democratic: Statewide, Quentin Palfrey took 59 percent of the vote to Jimmy Tingle’s 41 percent.

In Cambridge, the results were different: Tingle took 53 percent of 18,332 ballots (9,722) to Palfrey’s 47 percent (8,568).

Democratic challenger Palfrey will go on to face Republican incumbent Lt. Gov. Karyn E. Polito in a general election

Secretary of State

Democratic: Statewide, William Francis Galvin took 67 percent of the vote to Josh Zakim’s 33 percent.

In Cambridge, the results were different: Zakim took 51 percent of 19,338 ballots (9,826) to Galvin’s 49 percent (9,486).

Incumbent Democrat Galvin will face Republican challenger Anthony M. Amore in a general election.

U.S. Representative (7th District)

Democratic: Statewide, challenger Ayanna S. Pressley took 59 percent of the vote to incumbent Michael E. Capuano’s 41 percent.

In Cambridge, Pressley took 56 percent of 10,639 ballots cast (6,006) to Capuano’s 43 percent (4,626).

District Attorney, Northern District

Democratic: Statewide, incumbent Marian T. Ryan took 53 percent of the vote to challenger Donna Patalano’s 47 percent.

In Cambridge, the results were different: Patalano took 54 percent of 17,781 ballots (9,583) to Ryan’s 46 percent (8,164).

U.S. Senator

Republican: Statewide, Geoff Diehl took 55 percent of the vote to John Kingston’s 27 percent and Beth Joyce Lindstrom’s 18 percent.

In Cambridge, Diehl took 43 percent of 870 ballots cast (373) to Kingston’s 32 percent (275) and Beth Joyce Lindstrom’s 25 percent (215).

Republican challenger Diehl will face incumbent Democrat Elizabeth A. Warren in a general election.

U.S. Representative (5th District)

Republican: Statewide, John Hugo took 64 percent of the vote to Louis Kuchnir’s 36 percent.

In Cambridge, Hugo took 56 percent of 327 ballots cast (182) to Kuchnir’s 43 percent (141).

Hugo will face incumbent Democratic U.S. Rep Katherine M. Clark in a general election.

Attorney General

Republican: Statewide, James R. McMahon III took 61 percent of the vote to Daniel L. Shores’s 39 percent.

In Cambridge, McMahon took 54 percent of 690 ballots cast (370) to Shores’ 45 percent (308).

Republican challenger McMahon will face incumbent Democrat Maura Healey in a general election.

State Representative (25th Middlesex)

Democratic: Incumbent Marjorie C. Decker took 85 percent of the 6,663 ballots cast (5,666) to challenger Lesley Rebecca Phillips’ 15 percent (984).

Also in the general election:

Incumbent Democratic Treasurer Deborah B. Goldberg will face Republican challenger Keiko M. Orrall.

Incumbent Democratic Auditor Suzanne M. Bump will face Republican challenger Helen Brady and Libertarian challenger Daniel Fishman.

Unchallenged are incumbent Democratic member of the Governor’s Council Terrence W. Kennedy; Democratic state Sens. Joseph A. Boncore (1st Suffolk & Middlesex), Sal N. DiDomenico (Middlesex & Suffolk) and Patricia D. Jehlen (2nd Middlesex); and Democratic state Reps. David M. Rogers (24th Middlesex), Mike Connolly (26th Middlesex District, Jay D. Livingstone (8th Suffolk) and Jonathan Hecht (29th Middlesex); Clerk Of Courts Michael A. Sullivan; and Register Of Deeds Maria C. Curtatone.