Maryland Del. Cheryl B. Glenn, who chairs the Legislative Black Caucus, faced a last-minute defeat on the final day of the legislative session when a bill to diversify the medical marijuana industry failed. (Linda Davidson/The Washington Post)

The leader of Maryland’s powerful Legislative Black Caucus knew she was facing defeat.

Del. Cheryl D. Glenn (D-Baltimore) made diversifying the state’s new medical marijuana industry a top priority for the largest caucus in the General Assembly, and the issue is personal. Maryland’s marijuana-regulating commission is named after her mother, Natalie M. LaPrade, who died before she could use the drug to alleviate her cancer symptoms. As a black woman, Glenn was tired of seeing her neighbors disproportionately locked up under drug laws but shut out of the profits of drug legalization.

In the waning moments of the 2017 legislative session Monday, Glenn secured the votes for a bill giving minorities a shot at five new licenses to grow marijuana under the state’s lucrative medical cannabis program. But she ran out of time.

With 22 minutes until the midnight deadline to send bills to Gov. Larry Hogan (R), Glenn marched over to the dais as presiding officers allowed time to praise legislative staff instead of considering legislation. She stood watch, pleading for her bill to have a hearing.

With barely 10 minutes left, members of a health committee rushed into the hallway to vote on approving amendments to end a standoff with the Senate over giving licenses to a pair of prospective marijuana growers suing state regulators. At 11:55 p.m., the bill came up before the full House.

One by one, Republican lawmakers delayed the vote by explaining their opposition and asking questions until the clock hit midnight. Confetti and balloons fell from the balcony to celebrate the end of the 90-day session. Glenn did not smile and rushed out of the State House.

Asked about the failure of the medical marijuana legislation, House Speaker Michael E. Busch (D-Anne Arundel) quipped, “I need some.”

After months of fighting over who can share in the profits of marijuana legalization, Maryland lawmakers ended up back where they started. In a state that is nearly a third black, none of the companies approved to start growing Maryland’s first legal marijuana as early as this summer are owned by African Americans. And the state is still embroiled in a legal battle with two applicants who were rejected to make room for growers from underrepresented parts of the state; they planned to drop the lawsuit if the bill passed.

On Tuesday, Glenn said she would call on legislative leaders to hold a one-day special session to pass the medical marijuana bill. And she took a shot at Busch for not bringing the legislation up for a vote earlier.

“It’s not important to me what the speaker’s reasons or justifications were,” Glenn said. “What is important is to understand where this leaves the black community: It leaves us outside of the medical cannabis industry, and that is absolutely unacceptable.”

Alexandra Hughes, Busch’s chief of staff, said the speaker was devoted to reaching compromise on the medical marijuana bill and was not trying to undermine it.

A group representing the 15 cultivation companies approved last summer by the Maryland Medical Cannabis Commission celebrated the legislation’s defeat. They had lobbied against expanding the pool of growers, arguing that their business plans and pitches to investors were based on having an early and exclusive foothold in the industry.

“Our members never lost focus on the primary goal: getting medical cannabis to Maryland patients, hundreds of whom stepped up in Annapolis to make their voices heard,” said Rick Abbruzzese, a spokesman for the Maryland Wholesale Medical Cannabis Trade Association. “We can now continue to move forward, confident in our ability to deliver as planned by the end of this summer.”

Other winners in the bill’s defeat included the three marijuana companies that were next in line to get grower licenses if any of the top 15 failed their final inspections or background checks. They argued that the best way to diversify the industry was to leave the process alone, because two of those companies are minority-owned and the third is led by women.

The bill was derailed by the inclusion of licenses for the companies suing the state because they were originally ranked in the top 15 growers but were rejected in the name of geographic diversity. Republicans and some Democratic lawmakers balked at the idea of the General Assembly resolving a legal dispute through legislation, even though the provisions ultimately had enough support to pass.

“Our job here isn’t to pick winners and losers,” Sen. James Brochin (D-Baltimore County) said Monday.

Members of the 16-member Maryland Medical Cannabis Commission also were fighting for their jobs because the legislation that failed Monday would have dissolved the body. That, they say, would have deprived the state of its most knowledgeable marijuana regulators just when the program was about to go live.

“Any change to the structure of the commission would result in a delay in the implementation of the program,” said Paul W. Davies, the commission’s chair.

Critics of the legislation said it might have ended one lawsuit but would have prompted a new round of legal action from companies that stood to lose profits and market share.

“There’s a lot of money involved here,” said Senate President Thomas V. Mike Miller Jr. (D-Calvert). “Big, big, big money here.”