The General Assembly at work in Annapolis. (Jonathan Newton/The Washington Post)

The Maryland General Assembly passed two of the most closely watched bills of its 90-day session on Monday, giving final approval for legislation to improve school safety and address crime in Baltimore.

Hours before the session ended at midnight, lawmakers passed a bill to provide police coverage or school resource officers in every public high school. Legislators’ efforts to improve school safety gained momentum after the fatal shooting at Great Mills High School, which prompted Democratic leaders in both chambers and Gov. Larry Hogan (R) to promise action.

“We have really done something very important for the state,” said Sen. Steve Waugh (R-St. Mary’s), whose district includes the high school.

The legislation approved Monday would provide local jurisdictions $10 million in funds that could be used to provide police coverage or school resource officers in jurisdictions that do not have them. The bill would also require that public schools have lockable classrooms and hold age-appropriate active-threat drills.

Senate President Thomas V. Mike Miller Jr. (D-Calvert) called the legislation “a good start,” saying more will be needed to ensure that Marylanders feel safe. “It doesn’t stop,” he said.

Hogan said during a news conference that he and the Democratic leaders of both chambers came up with “an aggressive agenda” and accomplished almost everything on it.

Dels. C.T. Wilson (D-Charles County), left, Carl L. Anderton Jr. (R-Wicomico County) and William G. Folden (R-Frederick) enjoy a light moment during a session break. (Katherine Frey/The Washington Post)

“This is probably our most successful session out of all four years,” Hogan said, adding that he could not remember any session in which “any governor got this much done” with a legislature led by a different party.

The Senate also gave final approval to a package of crime bills backed by Hogan and Miller but opposed by criminal-justice advocates and some lawmakers. The bills, which include key provisions of a Senate measure that died after opposition from the black and Latino legislative caucuses in the House, have tougher penalties for repeat violent offenders but also include a provision allowing certain felonies to be expunged after 15 years.

“It’s a carrot-and-stick approach,” said Sen. Robert Zirkin (D-Baltimore County), the chairman of the Judicial Proceedings Committee. “For repeat violent offenders you need the stick, and for individuals who are trying to get their lives back together, there needs to be better carrots.”

Hogan said he supported the bills passed by the House, even though they were “watered down a little” from the Senate legislation he backed.

Del. Talmadge Branch (D-Baltimore City), whose grandson was fatally shot in September, said the infusion of funds for Baltimore’s successful Safe Streets program will “do wonders” for the city.

Also on Monday, lawmakers sent a bill to Hogan’s desk that will create a new set of rules for dealing with sexual misconduct in the statehouse, which has been roiled this session by allegations of harassment.

Lawmakers also passed a bill to diversify Maryland’s medical marijuana industry — one year after a similar effort failed in a bitter last-minute defeat.

The bill, which must be signed by Hogan, who said he has not yet reviewed it, would increase the number of licenses for marijuana growers and processors, and requires that they be awarded in a process that gives preference to minority-owned businesses, which were nearly shut out of the initial round of licensing.

About one-third of Maryland residents are African American, but none of the 14 companies that have lucrative licenses to grow medical marijuana are led by black executives.

The legislation approved by both chambers would increase the number of growing licenses from 15 to as many as 22, and the number of processing licenses from 15 to 28. Two growing licenses would be set aside for the companies that sued the state because they say regulators illegally rejected them in favor of lower-ranking advocates — a provision that was opposed by lawmakers last year who said legislation should not be used to settle legal matters.

The bill would also designate new processing licenses for several companies that already have growing licenses, a provision the bill’s critics say provides an unnecessary boon to wealthy companies.

In the final hours of the session, the General Assembly approved a bill intended to keep guns out of the hands of people who are a danger to themselves and others. The “red flag” bill was opposed by some Republican lawmakers who questioned whether it could pose a threat to the Second Amendment.

Meanwhile, lawmakers scrambled to work out agreements on other measures, including a bill that would decide the age that teens can marry. Currently, 15-year-olds can wed in Maryland, and the House passed a bill raising the age to 17 while the Senate version moves it to 16.

“It is, in my opinion, it would be outrageous to leave allowing 15-year-olds to marry,” said Zirkin, the Senate bill sponsor.

The General Assembly wrapped up action on a bill that makes it easier for prosecutors to go after repeat sexual offenders, allowing past sexual offenses to be referenced during their trials. The bill eliminates state income tax on a portion of the pensions of retired military and retired correctional officers. They also approved a bill that would make Maryland the first state to regulate political ads on social media.

The legislative day started on a somber note in the Senate with nine veteran lawmakers ending their legislative careers and other lawmakers mourning the deaths of family members, including the wife of Del. David Fraser-Hildalgo (D-Montgomery), the mother of Sen. Johnny Ray Sallings (R-Baltimore County) and the brother of Sen. C. Anthony Muse (D-Prince George’s).

Before mention of the losses, Sen. Nathaniel McFadden (D-Baltimore City), who is facing a tough primary battle, and Sen. Edward Kasemeyer (D-Baltimore County), who is retiring after a more than 30-year legislative career, wiped tears from their eyes as the session got underway. Miller also appeared emotional.

Kasemeyer has been capturing his final stretch on video.

“You get a little teary-eyed thinking about it,” he said. “I’ve had great days here. It’s hard to leave, but it’s the best thing for me.”

Lawmakers finished much of their work before the clock ran out, sending bipartisan measures to the governor that provide $167 million in dedicated funding to stabilize the Metro transit system; create an $8.5 billion package to lure’s second headquarters to Montgomery County; and develop a one-year plan to stabilize individual health insurance premiums.