AUGUSTA — Maine lawmakers voted to legalize sports betting, tax e-cigarettes and adopt a presidential primary system during a marathon final day of the 2019 legislative session.

But a partisan split over state borrowing scuttled a $239 million bond proposal for transportation, land conservation and broadband projects. That means lawmakers could be called back into session later this year to reconsider bonds and potentially take up other bills – including whether Mainers should use ranked-choice voting in presidential elections – that were left in legislative limbo.

Weary lawmakers blew past their midnight deadline and stayed in session until roughly 6:30 a.m. Thursday as they tried to finish their work. Reviving a Maine tradition largely abandoned by her predecessor, Democratic Gov. Janet Mills addressed both chambers just prior to adjournment and thanked lawmakers for their work.

“Remember why you do this work,” said Mills, a former legislator and attorney general. “You do it for all the people of Maine.”

Some notable bills failed to pass both the House and Senate prior to the early-morning adjournment.

For instance, the Senate never took up a bill that would have relaxed restrictions on state-financed welfare benefits flowing to non-citizens, such as the asylum seekers filling homeless shelters in Portland.

On Wednesday afternoon, the House voted 88-51 – largely along party lines – in support of allowing legally present non-citizens to receive General Assistance, Temporary Assistance for Needy Families, food stamps and other benefits. The bill did not contain any new money, however, and only directed the Maine Department of Health and Human Services to provide assistance “within available resources.”

That bill was among more than 200 that were kept alive by being “carried over” until either next year’s legislative session or a special session this year.

The highest-profile failure, however, involved the $239 million bond package. Mills’ proposal was broken down into: $105 million for road, bridge and infrastructure repair; $50 million for research and development, expanding broadband and fishing/farming infrastructure; $65 million for wastewater treatment projects, renewable energy and the Land for Maine’s Future program; and $19 million for career and technical education or child care.

But the package failed to receive the two-thirds majorities needed to send it to voters. Republican lawmakers, who opposed taking on so much debt following passage of an $8 billion budget, wanted separate votes on each of the four measures but Democrats insisted on a single vote rather than risk losing parts of the package.

“We do realize that transportation infrastructure improvements will help soften the negative impact that additional regulations and unsustainable spending passed by Democrats this session will have on our economy,” House Minority Leader Kathleen Dillingham, R-Oxford, said in a statement. “We offered an avenue to ensure we are able to get a mutually agreed upon bond package for roads and bridges out to voters.”

Mills hinted Thursday that she would likely call lawmakers back to Augusta to deal with bonds, but not immediately.

“In the coming weeks and months, we will continue to talk about getting a bond package out in November,” Mills said, according to a report from Maine Public. “We are not giving up. I think people just need a break.”

During the day Wednesday, lawmakers completed work on a host of bills and sent them to Mills for her signature.

One measure would make Maine the latest state to legalize sports betting. Adults age 21 and older will be allowed to cast bets on professional, collegiate and some amateur sports at licensed facilities, such as Maine’s existing casinos or off-track betting parlors, or online via licensed gambling operators.

Another bill that Mills signed late Wednesday or early Thursday, L.D. 1626, will add Maine to the list of states holding presidential primaries on “Super Tuesday” next March. The push to switch to presidential primaries gained traction after some caucus locations were overwhelmed by high turnout during the 2016 presidential caucuses.

“Presidential primaries offer a more convenient and accessible voting experience,” bill sponsor Sen. Louis Luchini, D-Ellsworth, said in a statement. “I believe primaries will significantly increase voter participation, strengthening our democracy.”

It is unclear whether Mainers will be able to utilize the state’s new ranked-choice voting system for those March primaries or the presidential general election in November, however. A bill, L.D. 1083, to authorize ranked-choice balloting for presidential elections also got hung up in the Legislature and was shelved, for now.

According to Secretary of State Matt Dunlap’s office, the law would have to be in effect by the first week of December in order for election officials to implement ranked-choice voting for the March presidential primaries. That means supporters would need to pass the bill in a special session by late August or early September, so the law would have the required 90 days to go into effect.

Lawmakers also gave final approval to the complex set of rules, L.D. 719, that will regulate the sale of recreational marijuana, potentially beginning next spring. Maine voters legalized marijuana use and possession for adults in November 2016, but the state and lawmakers have been slow to roll out retail sales of the drug.

Ambulance services are also due to receive a long-awaited boost in their reimbursement rates under a bill that passed in the final hours.

And lawmakers passed a bill – negotiated by the Mills administration, the Sportsman’s Alliance of Maine and other stakeholders – that will allow police to take guns from a person in “protective custody” if they are deemed a threat to themselves or others. That bill, L.D. 1811, was an alternative to a more controversial “red flag” gun bill sought by gun control and gun safety groups.

The Legislature could also return to Augusta for a day to respond to any vetoes from Mills.