BOSTON (AP) — Two Democrats, one making a political comeback and the other a 24-year-old newcomer, have won seats in the Massachusetts Legislature.

Former North Adams Mayor John Barrett defeated Republican Christine Canning Tuesday in a special House election in northern Berkshire County. The 70-year-old Barrett served as mayor for 26 years until leaving office in 2009.

He will serve out the remainder of the term of Democrat Gailanne Cariddi, who died of cancer in June.

Haverhill City Councilor Andres Vargas outpolled Republican Shaun Toohey to take the seat formerly held by Democratic House Ways and Means chairman Brian Dempsey, who left the Legislature to join a Boston lobbying firm.

Vargas was the first Latino elected to the Haverhill City Council when he won a seat in 2015 at the age of 22.