Top elected officials from both parties at the federal, state, and local levels will team up next month for a rare bipartisan fund-raiser, hoping to block a ballot measure that would legalize marijuana for recreational use in Massachusetts.

Governor Charlie Baker, Lieutenant Governor Karyn Polito, US Representatives Joseph P. Kennedy III and Niki Tsongas, Boston Mayor Martin J. Walsh, and House Speaker Robert DeLeo are among those listed on the invitation for the Oct. 6 luncheon fund-raiser in Boston.

The event will raise money for Safe and Healthy Massachusetts, the ballot committee gearing up for a November vote on Question 4.