Like college freshmen scurrying to finish their term papers, Massachusetts legislators showed that procrastination doesn't always spell doom. Before last night's deadline, they squeaked through bills aimed at reducing gun violence, creating jobs and strengthening domestic violence rules.

Throughout the day, the State House halls were humming, spilling over with lobbyists of every type.

"The last day of the session, anything can happen," said Jon Hurst, president of the Massachusetts Retailers Association. "Everyone is pushing for their pet bill to come through, so you have to be vigilant."

Hurst says you can have as many bills pass in one day as in months prior.

One of the most closely watched bills would tighten the state’s already tough gun laws. Lawmakers started working on the bill after the Newtown massacre, one and half years ago.

A major sticking point was whether to give police chiefs the ability to deny someone a license for a rifle or a shotgun, even after the person passes a background check. The police already have this power for handguns.

Eventually, House and Senate negotiators worked out a compromise: If police chiefs want to deny a license for a rifle or shotgun, they have to petition a judge.

"If the chief feels someone is unsuitable, he has the right to petition the court," said State Sen. Michael O. Moore, the vice chair of the Committee on Public Safety. "And when he petitions the court, he has to document for why the person is unsuitable. The onus is on him."

It’s a compromise that both anti-gun control and pro-gun control folks can live with. Or most of them, anyway.

In a rare move, the National Rifle Association is breaking with its local affiliate, the Gun Owners Action League, to oppose the bill.

"Their big thing is they don’t want to set national precedents," said Jim Wallace, president of GOAL. "And when you’re a national organization representing Texas and Massachusetts, it’s a lot different from just representing Massachusetts."

Not as sexy as the gun bill is the economic development one: a complicated, sprawling piece of legislation. It spends about $82 million, supporters say, to stimulate the Massachusetts economy.

State Rep. Joseph Wagner shepherded it through the long legislative process.

"There are a lot of pieces to it," he said.

And by that, he means there’s a lot of money for a lot of lawmakers’ favorite projects.

"We target initiatives going to the innovative economy, creative economy, manufacturing," Wagner said.

One provision would extend a tax credit for Broadway and off-Broadway plays that come through the state. It would also direct the office of tourism to spend money marketing Massachusetts to international travelers. And it would give Boston more liquor licenses.

Another bill would overhaul the state’s domestic violence laws — a bill lawmakers only began working on last summer, after Jared Remy, the son of the Red Sox broadcaster, was charged with stabbing his girlfriend to death.

"It offers some stricter penalties, it also offers a lot more education and training for all of the folks involved, whether it be the court, the D.A.s, the probation, for schools," said state Sen. Karen Spilka, the sponsor of the bill, which would also increase privacy protections for victims by prohibiting information about domestic violence arrests from being included in daily public police logs.

The Newspaper Publishing Association objected, saying that might have the unintended consequence of shielding perpetrators from exposure.

Minutes before midnight, it was looking like the Newspaper Association would have nothing to worry about. None of these bills were finished. So the deadline was extended past midnight. And then extended again. But eventually, the bills got through to the governor’s desk. Now he has 10 days to sort through them and decide which become law.