Rep. Ed Markey reacts with his wife, Susan Blumenthal, in Boston after winning the Democratic primary for the special U.S. Senate election. (Elise Amendola/Associated Press) Rep. Ed Markey reacts with his wife, Susan Blumenthal, in Boston after winning the Democratic primary for the special U.S. Senate election. (Elise Amendola/Associated Press)

Democratic Rep. Ed Markey won a solid victory over his more conservative House colleague Stephen Lynch in Tuesday’s Democratic primary for the special U.S. Senate election in Massachusetts. Markey is a clear favorite over Republican nominee Gabriel Gomez. But the primary returns point to places where Markey will have to watch his back, and Gomez will see opportunities.

Markey overwhelmingly won the state’s most liberal counties. The returns available this morning show that Markey swept western Massachusetts: he won 77 percent in Berkshire County, 80 percent in Franklin County and 83 percent in Hampshire County. Markey also did very well on Cape Cod and the islands, and won solid victories in the two big, diverse Boston suburban counties of Middlesex (69 percent) and Essex (57 percent).

But if Gomez is to have any chance, he will have to repeat Scott Brown’s performance in the outer suburbs and in blue collar areas. Here, the primary returns show at least an opportunity for Gomez while offering a warning for Markey. Lynch was clinging to a narrow lead in Bristol County, a largely blue collar area (where I grew up) in the southern part of the state; he had a similarly small lead in Worcester County, a similarly blue collar area; and he won solidly in Plymouth and Norfolk, middle-middle class counties that often swing Republican in elections that Republicans win. Suffolk County, dominated by Boston, Lynch’s home base, went narrowly for Markey, 53 percent to 47 percent.

Republicans such as Brown win when they cut into the Democratic vote in the old blue collar cities around the state and carry the middle-of-the-road vote in suburbs that are middle class but not as affluent as the liberal suburban bastions in counties such as Middlesex. Lynch’s support shows that this potential, at least, is there.

If you had to lay down a bet now, you would wager that Markey will win the June 25 special election, and probably by a decent margin. The mood is very different than it was when Brown won in January, 2010. That was a nadir for President Obama, and the height of the tea party mobilization. Democrats were complacent and did not realize the danger facing their nominee, Martha Coakley, until much too late. Thanks to Brown, there is no complacency this time, and Markey has shown no signs of taking this for granted. Gomez has not captured the state’s imagination the way Brown did with his pickup truck and down-home style. And last year, Obama carried Massachusetts by 23 points over the state’s former governor, Mitt Romney, while Elizabeth Warren solidly beat Brown for the Senate seat.

Still, turnout was very low in this primary and Markey will have to work hard to turn out Democrats on a day when people in the Bay State are not accustomed to voting for anything. And if Democrats need any further warnings against complacency, they can study the pattern of Stephen Lynch’s vote. It defines Markey’s weak spots and Gomez’s opportunities.

E.J. Dionne writes about politics in a twice-weekly column and on the PostPartisan blog. He is also a senior fellow in Governance Studies at the Brookings Institution, a government professor at Georgetown University and a frequent commentator on politics for National Public Radio, ABC’s “This Week” and NBC’s “Meet the Press.”