It wasn't just the priorities of lawmakers that went down to the wire last week when the state Legislature wrapped up its final night of formal sessions for the year. Republican Gov. Charlie Baker also had quite a few priorities he wanted to get through the overwhelmingly Democratic Legislature and he came away from the session with a mixed record.

"Even though he has a good relationship with the Legislature, they’re all Democrats. So usually, governors in split-party-controlled states have real trouble getting their legislative agenda through. And so any successes for him are pretty good," UMass Boston political science professor Erin O'Brien told WGBH News.

The biggest win for Baker was the bill he'd been pushing for the hardest: his "CARE Act" opiate treatment legislation. Many of the provisions laid out by Baker in his initial filing made it through the Legislature and are now on his desk to be signed. Among the slew of elements in the bill, Baker advocated for stricter regulations for dispensers of opiate treatment, increasing alternative pain medications, and allowing doctors to partially fill prescriptions of addictive painkillers.

But Baker didn't get everything he asked for. Lawmakers rejected Baker's bid to let doctors hold overdose patients for up to 72 hours for involuntarily treatment. The House never even considered the option, and the Senate replaced it with a hold option only when courthouses are closed and a traditional hold order can't be procured. In the chambers' final compromise, the hold language was reduced to a "study" of the issue.

“Charlie Baker’s more interested in passing or being able to attach his name to something on the opioid crisis than he is in the policy specifics. I don’t mean that to say that he doesn’t care about specific policy, but for him the political win is to be able to come back and say ‘we did something on opioids, and we did it with a Democratic Legislature," O'Brien said.

At the end of the Legislature's two-year session, Democrats pushed their negotiations to the very last minute, using the session deadline to spur compromise between the House and Senate. Baker had been critical of the Legislature for not getting a budget done on time, which made the end-of-session crunch even more hectic.

"I had said earlier that I was concerned that the fact that the budget dragged on early into July and then we lost a couple of weeks, in July, where the budget was still being debated and discussed, that I thought that was going to be an opportunity cost with respect to their ability to deal with some other things and I think in some cases, that turned out to be true," Baker said after the final gavel fell early last Wednesday morning.

Baker's agenda had more success when it came to spending, with the Legislature drawing open the state's purse strings to authorize multiple borrowing bills that will allow Baker to invest in projects and construction around the state. In a job-boosting economic development bill, the law will grant Baker the authority to doll out nearly $1.2 billion in project money for job training, municipal grants, infrastructure and more. Similar bond borrowing bills, with equally high bottom lines, were passed for housing development, life sciences and environmental improvements.

Perhaps Baker's biggest disappointment this session was that the Legislature didn't even take up a bill that would have allowed cities and towns to relax zoning rules to bring in more development, his "Housing Choices" legislation. Baker had been all but begging Speaker Robert DeLeo and former Senate President Chandler to take up the bill for weeks, but after two powerful lobbies got involved and time ticked toward the end for the session, Baker's bill was sent to the legislative dust bin.

“I haven’t given up on that one. It didn’t happen in the formal session, but they will be meeting in informal session. I think there’s a lot of support for it, and I will continue to advocate for it," Baker told reporters.

Framingham State University political science professor David Smailes said the late-session loss sets Baker up for another push on housing legislation at the outset of the 2019 session.

“It’s the kind of thing where you can advance an issue. Perhaps we’ll lose on it today, but hope to win on it in the future, so it’s still worth putting out there," said Smailes.

Baker's greatest difficulty in this election year, according to Smailes, "is that once you’ve committed yourself to a policy like that, and you’re trying to get an initiative like that passed, you know the failure comes back to reflect on you and your own power. You know, the sense that people have of your power. And that makes it more difficult to get things done.”

The legislature also stalled on, or outright ignored, a number of Baker's proposals for things like tougher sentences for repeat child rapists, updates to the state's wiretapping laws, and making so-called "revenge porn" a crime.

The governor got an unexpected win when it came to the bill to tax and regulate Airbnb rentals. Because of the late-session delay, Democrats surrendered the ability to supercede amendments proposed by the executive. Baker's amendment to let people who rent out their place for less than two weeks could stick in the final law instead of being overridden by the Democrats.