BOSTON — House and Senate Democrats failed to reach a compromise on long-discussed distracted driving legislation after a marathon session Wednesday, abandoning the issue about four hours after Senate President Karen Spilka said a resolution appeared imminent.

Both branches held sessions open from Wednesday afternoon until after 12:00 a.m. Thursday in what was expected to be the last day before a traditional August recess.

With a six-member conference committee privately negotiating the mobile device ban, Spilka told the News Service around 7:45 p.m. that there was an "agreement in principle" and that she expected the matter "should be done tonight."

Earlier in the day, House Speaker Robert DeLeo said he was "waiting anxiously" for a consensus bill, but unsure when one would arrive.

Legislators waited for hours, but no driving bill surfaced for a vote before both branches departed.

"They were really close when we talked last," Spilka told the News Service after session ended around 12:15 a.m. "They are still really close. There's a few areas they needed to work out, and it's better to get it done right than just get it done. They'll continue to be talking and they're working very closely."

On Friday, Sen. Mark Montigny, who has been pushing for a stricter distracted driving law since 2004, said July 31 "should be the deadline for final action" because life-saving changes shouldn't wait any longer.

"While we all want to ensure this issue is fully vetted, we have had over 15 years to do so," Montigny wrote in a letter to the negotiators.

"Each day we fail to take action results in injury, property damage, and loss of life. Families who have lost loved ones to distracted driving are also left in limbo, wondering whether we are really serious about preventing future tragedies."

Spilka pointed to a seven-hour oversight hearing that the Transportation Committee, which includes all of the conferees, held on Tuesday as a possible reason for the delay.

However, four Democrats and two Republicans appointed to the committee have been privately discussing the legislation, which would require hands-free use of all mobile devices while driving, since June 19.

Texting and emailing while driving is already illegal in Massachusetts, but the 2010 law does not address other ways electronic devices and smartphones are used, allowing distracted driving to continue.

Both branches passed bills implementing additional bans on virtually all handheld device usage, measures that Gov. Charlie Baker supports. However, the Senate version would require law enforcement to track demographic data for all traffic stops while the House version would only monitor stops that end in a citation issued.

The Senate bill also requires drivers to take a class after a second offense of the new provision and categorizes third and subsequent violations as surchargeable offenses for insurance, both points that the House did not include.

Conferees were tasked with working out those differences and producing a single bill. They faced additional pressure to finish their work before lawmakers take a traditional August recess, but under rules, the branches could return for a formal session at any time until mid-November to approve the legislation.

Spilka would not say if the Legislature would return during its August recess to take up the committee's bill or if it would wait until September.

"We'll see what time they come back," she said. "We'll deal with it when they're done."

Senate Minority Leader Bruce Tarr had pushed for the Senate to adjourn slightly earlier in the night, arguing that members should not have been expected to read the bill and vote on it so quickly. Rules require conference committees to file reports by 8 p.m. for them to be taken up at 1 p.m. the following day, although lawmakers can agree to suspend that.

"This Senate has worked far too long and far too hard for this to be happening, for us to take this up without being able to read it," Tarr said.

"We have an alternative, to act in a statesmanlike way to give conferees the chance to finalize the details without the pressure of trying to finish by midnight tonight."

More From WBSM-AM/AM 1420