In their final debate before polls open Tuesday, Gov. Charlie Baker and his challenger, Democrat Jay Gonzalez, sparred over transportation and Donald Trump, showcasing the local and national factors at play this election.

It was just Baker and Gonzalez before the cameras last night, but President Donald Trump's presence was front and center.

"We've got a president right now who is threatening our values. Who is taking this country backwards. Who's threatening our democracy. And you, you're putting loyalty to the Republican Party above your commitment to these values," Gonzalez accused Baker during the debate hosted by WCVB, The Boston Globe, WBUR, UMass Boston and an association of Western Massachusetts media outlets.

Gonzalez has tried to tie Baker, the popular moderate Republican incumbent, to Trump, the locally unpopular head of the the national GOP, ever since the governor committed to supporting his party's conservative nominees for Attorney General and U.S. Senate.

Baker countered that he's opposed Trump's immigration and abortion plans and works with Democrats in power in Massachusetts to push back on presidential policies he doesn't support.

"This isn't a race for Attorney general. It's not a race for the US Senate. It's a race for governor and I'll put my track record on these issues up against anybody," Baker said.

But Baker is in a bind since officially backing Senate candidate state Rep. Geoff Diehl and AG nominee Jay McMahon.

"That said, I said at the very beginning of the campaign months and months ago that I would support the ticket I plan to honor my word on that," Baker said.

Gonzalez, who has seen little traction with voters since capturing his party's nomination and has struggled with name recognition and fund raising compared to Baker, did not waste the opportunity to bash the governor over the head with his own partisan vow.

"The governor is saying his loyalties are to the Republican Party regardless of the consequences, regardless of having someone who's going to go in to be our Attorney General or to replace Elizabeth Warren in the United States Senate who is anti-choice, who is anti-common sense gun laws, anti- a lot of the stuff you say you're for," Gonzalez said.

Gonzalez and Baker also tussled over the incumbent's handling of reforms at the MBTA and how to fund the massive effort to fix the state's transit system.

"The governor said that his performance should be measured based on the reliability and dependability of the MBTA. So how about this, if you believe that your commute is better now than it was four years ago, then you should vote for Charlie Baker," Gonzalez said, adding that Baker's fixes aren't happening fast enough to help frustrated commuters.

Baker says his $8 billion funding plan for the next five year is more than double what the T has spent in its history, while Gonzalez's plan to raise taxes on the wealthy by $1 billion would take years to kick in and hardly covers the laundry list of progressive projects Gonzalez has touted on the campaign trail

"[Gonzalez] spent that billion dollars five times since this debate started. You spend it three times on transportation, you just spent it again on early childhood ed.," Baker accused, mentioning Gonzalez's proposal to increase spending on pre-k education.

"It's dishonest to stand here in front of the voters and say you're going to be bold and then talk about initiatives that cost billions of dollars that you don't have the dollars to pay for," Baker said.

Gonzalez full plan would require a constitutional amendment to add a surtax on incomes over $1 million a year, accounting for $1 billion, and a new tax on university endowments his campaign says would bring in another $2 billion.