For 15 years, legal advocates in Maryland have fought for a right they considered shamefully absent for poor people who get arrested: Getting a lawyer before they’re booked into jail.

Last month, Maryland’s highest court agreed with the advocates. But there’s a big problem, one that has grabbed the attention of the legal community statewide: Who will pay for it?

“It’s a crisis,” said Sen. Brian E. Frosh (D-Montgomery), chairman of the senate’s Judicial Proceedings Committee. Frosh put the annual price tag in the tens of millions.

On Thursday, the Maryland Court of Appeals pushed back enforcement of its opinion until at least March 5 as officials scramble to find alternatives.

At issue are the complexities and long-standing problems of post-arrest procedures in Maryland. Arrestees are first brought before a “court commissioner,” officials who often work in the gritty, booking portions of county jails. The commissioners decide whether to release the arrestee pending trial, assign a bail amount that must be posted before he can be released, or — in the case of serious crimes — order the suspect held without bail.

Those held are then taken before a judge for a bail review, generally the next business day.

The court ruling would require a public defender to attend those initial hearings. But Frosh and others want to change state law to a solution they say would be far less expensive: requiring defense lawyers during the second stage, bail review.

That delay would still be too long for some advocates. But it would end what is widely seen as an untenable situation in 21 out of 24 Maryland jurisdictions, where, because of budget constraints, poor people don’t have representation at bail review hearings. As a result, even those held on minor charges can face stiff bonds that keep them locked up.

“When they’re not represented, they’re sort of at the mercy of the system,” said Paul DeWolfe, the chief public defender in Maryland.

Only three jurisdictions — Montgomery County, Harford County and Baltimore City — assign public defenders to the bail review hearings. DeWolfe said getting more funding to staff these hearings statewide “would be a great step forward.”

A University of Maryland law professor, Douglas Colbert, has spearheaded the battle over bail. Now gray-haired and 65 years old, Colbert grew up in Queens, and in high school was so inspired by the civil rights movement that he and friends rented a bus to go see Martin Luther King Jr. speak on the steps of the Lincoln Memorial in 1963.

Colbert went on to law school and spent 20 years defending people in poverty in New York City. In 1994, Maryland’s law school recruited him. Colbert established a legal clinic staffed by his students, and learned that poor people weren’t represented when their bail was set.

“I was stunned,” Colbert said. “The legal system just accepted it as the way things were done.”

Years of committee efforts and legal battles ensued. Colbert has always taken the position that low-income defendants deserve a lawyer from the outset. On Jan. 4, the Maryland Court of Appeals sided with him, ruling that public defenders must be present at the first hearings. But other members of the criminal justice system — jailers, prosecutors and the public defenders — immediately pointed out how expensive this could be.

DeWolfe estimates that he would need at least $23 million annually to hire enough lawyers to work the initial arrestee hearings. Prosecutors, in turn, would send their own lawyers, pushing the price tag past $46 million in attorneys alone, according to John McCarthy, the state’s attorney for Montgomery County. Then there are the logistics of where many of the initial hearings take place, and the costs of retrofitting those areas.

In Montgomery, arrestees are taken to a decades-old jail and led into a 4-by-4-foot alcove. They are handcuffed to a wall and speak to a commissioner through a thick glass. To implement the appeals court ruling, defense lawyers and prosecutors would be led into the tiny area as well, standing shoulder-to-shoulder with an arrestee to make their arguments. That set-up would demand a fourth person — a correctional officer to make sure no one gets hurt, said Arthur Wallenstein, Montgomery’s director of corrections, who estimates spending an additional $500,000 a year for the increased staffing.

Frosh said his compromise would cost far less because staffing requirements don’t extend round-the-clock. Statistics show that in many instances where people are charged with minor crimes, commissioners release defendants on their own recognizance — essentially on their word they will return to court. Last year, 176,523 people appeared at those hearings statewide, and 77,704 were released on their own recognizance.

McCarthy added that pushing the requirement to the bail hearing gives jail officials and public defenders time to verify the addresses or employment of arrestees, which can help spring them from jail.

Frosh wants other changes as well, namely prohibitions against locking up people for very minor offenses, and adding bail-review hearings on Saturdays and Sundays.

But Colbert, the professor, said that in the long run, having lawyers at both hearings would save money, because fewer people would be booked into jails in the first place. If the legislators pass their compromise, Colbert said, he will return to the appeals court to continue his fight.

“Everyone accused of a crime must have access to a lawyer to protect their most precious right: Their freedom,” he said.