The State House in Annapolis, Md. on the last day of the legislative session. (Marvin Joseph/The Washington Post)

The Maryland General Assembly completed one of its busiest sessions in years Monday, giving final approval to bills to legalize medical marijuana, expand early voting and help launch the construction of a new regional hospital in Prince George’s County.

Lawmakers also stepped up restrictions on using cellphones while driving and passed legislation that would encourage private investors to pay for highways, bridges and other major projects. With a midnight deadline looming, they also approved a campaign finance bill that would raise the amount donors can give while seeking to clamp down on corporations that use a loophole to make multiple contributions to the same candidate.

The final day capped an extraordinarily productive 90-day session that was filled with several high-profile bills, many of them decidedly liberal. Gov. Martin O’Malley (D), who was seeking to cement his legacy before he risks becoming a lame duck next year, pushed through a full agenda, including several bills that previously failed.

Even before lawmakers arrived Monday, O’Malley had secured wins on one of the most sweeping gun-control packages in the nation; the state’s first gas tax increase since 1992; the repeal of the death penalty; and a measure to broaden Maryland’s use of renewable energy by providing incentives for an offshore wind farm.

Other bills passed in recent days would expand a program that allows illegal immigrants to get driver’s licenses and grant additional authority to Prince George’s County Executive Rushern L. Baker III (D) over the governance of his jurisdiction’s schools.

“Are we the Southern state that we used to be? No, we’re not,” Senate President Thomas V. Mike Miller Jr. (D-Calvert) told reporters during a break between voting sessions. “The state has become more progressive, there’s no doubt about it. Maryland does look liberal. . . . That’s good news to some, bad news to others.”

A relatively clear path to adjournment Monday stood in marked contrast to last year’s session, when brinkmanship over the state budget and gambling legislation led to the session’s collapse on an acrimonious final night.

The traditional midnight confetti and balloon drops were scotched, and O’Malley wound up summoning lawmakers to Annapolis for two special sessions to finish their work.

“This has to be the most orderly conclusion that I’ve seen,” said O’Malley, speaking of the seven regular sessions that have taken place since his arrival in 2007. His second terms ends in January 2015.

There were several reasons that measures that had failed before reached a tipping point this year. Some benefited from more sympathetic lawmakers elected in 2010. And some were helped by outside events.

Scaled-back legislation

The governor’s gun package, which includes an assault weapons ban and tough licensing requirements for gun purchases, emerged in the wake of the Connecticut school shootings. Talk got far more serious in Maryland about a transportation funding package after a plan was championed by Virginia Gov. Robert F. McDonnell, a Republican.

Other bills were scaled back to make them more palatable.

That was true of the medical marijuana bill, which received final approval from the Senate in a 42 to 4 vote. This year’s approach was more limited, allowing distribution only by academic medical centers.

Under the bill, the centers would be required to monitor patients and publish their findings, an approach that health officials in O’Malley’s administration have characterized as cautious enough to win their support.

Legislative analysts say it is unlikely that dispensing medical marijuana would begin before 2016. It is also unclear how many institutions might choose to participate. Two of the state’s most prominent — the University of Maryland Medical System and Johns Hopkins University — have been reluctant to get involved.

But supporters of the bill hailed it as a significant step toward a compassionate treatment option for people with such illnesses as cancer and multiple sclerosis. Eighteen states and the District have enacted similar laws.

“I’m proud to be a part of this,” said Sen. James N. Mathias Jr. (D-Worcester), whose wife died of cancer two years ago.

Del. Dan K. Morhaim (D-Baltimore County), the chief sponsor of the bill, suggested that institutions would come on board now that the legislation has passed.

“I appreciate their cautious approach,” Morhaim said. “They wanted to see what the bill looks like before they go ahead, and now they can.”

Meanwhile, separate legislation, passed last month in the Senate, that would have decriminalized small amounts of marijuana remained bottled up in the House Judiciary Committee. Asked whether he planned a vote on the bill, the panel’s chairman, Del. Joseph F. Vallario Jr. (D-Prince George’s), said: “No, no, no. Bad message to the kids.”

The bill would have subjected people caught with 10 grams or less to a civil fine of $100, a move supporters argued would ease criminal caseloads in the courts.

The Senate also gave final approval, 38 to 9, on Monday to a bill that would for the first time allow residents to register to vote and cast a ballot on the same day.

Same-day registration would be available during early voting, which under the bill would be expanded from six days to eight. In addition, the bill would increase the number of early voting sites. The measure was proposed by O’Malley following the state’s first attempt at early voting during a presidential year, when thousands of voters in the Washington suburbs and elsewhere stood in line for hours.

The legislature also signed off on another of O’Malley’s remaining priorities, a bill that makes it state policy to seek out private investors to build roads, bridges, schools, libraries, state office buildings and other big-ticket items.

Such public-private partnerships have long been supported by several Republican-led states, including Virginia, but they have gained in popularity among Democratic-led states amid prolonged budget shortfalls.

Maryland lawmakers also gave final approval to a bill that would allow police officers to pull motorists over for talking on hand-held cellphones. The practice is already illegal but is classified as a secondary offense, meaning drivers can’t be cited unless they are stopped for another infraction.

Prince George’s hospital

With relatively little debate, Maryland lawmakers also approved the last piece of the state’s budget, which included a down payment of $20 million toward construction of a new hospital center in Prince George’s.

The state has committed to paying nearly a third of the cost for the estimated $650 million facility, a location for which has not been chosen. The legislature also directed another $10 million to keep afloat the county’s existing hospital in Cheverly, which could be converted to an outpatient facility after a new one is completed.

Del. Melony G. Griffith (D-Prince George’s), vice chairwoman of the capital budget committee, said she was pleased that the state was “finally putting its money where its mouth is” regarding funding a new hospital.

Lawmakers worked late Monday to come to terms on a campaign-finance bill that would make several major changes to Maryland’s laws, including raising the amount that donors may give to candidates.

House and Senate negotiators resolved a handful of differences, including a provision tucked in the bill by senators that would move the filing date for candidates for state offices — including the General Assembly — from April to January. They settled on February.

One issue that was defeated, however, was a measure to establish new standards for liability for dog bites.

The issue has been a thorn in the side of the legislature since Maryland’s highest court last year made the state the only one nationwide to hold owners and landlords of just one breed — pit bulls — strictly liable for injuries. Some landlords forced renters with the animals to leave or give up their pets after the ruling.

Under a compromise approved by the Senate, dog owners of all breeds would have been held strictly liable for injuries to a child younger than 13. In other cases, victims would have had to have shown a preponderance of evidence that a dog owner knew the animal was dangerous.

But the plan faced stiff opposition in the House and was never brought to a final vote.

“Poor dogs got the bone,” Miller said.

Kate Havard and Miranda S. Spivack contributed to this report.