The Maryland Senate agreed Wednesday to consider amending the state constitution to overturn rulings by its highest court on pretrial confinement rather than pursue a costly overhaul of the state’s current system for setting bail.

But opponents warned that the General Assembly was risking a fullblown showdown involving all three branches of government if lawmakers adopt the amendment or otherwise fail to address the concerns raised by the Court of Appeals about the state’s bail-setting procedures.

With less than two weeks before the annual legislative session’s conclusion, Sen. Robert A. Zirkin (D-Baltimore County) proposed a constitutional amendment that would overturn the Court of Appeals’s rulings in DeWolfe v. Richmond, which triggered a sweeping reexamination of pretrial detention in the state.

The high court found that the state’s unusual and duplicative system of using court commissioners to set bail, often without an attorney present, has failed to provide adequate protection of defendants’ legal rights and meant that many people have been held in custody unnecessarily. The court ruled that every defendant, including the poor, is entitled to legal counsel from the earliest court proceedings, including bail hearings. Estimates of the cost to provide such legal counsel at every step, however, have reached $30 million and more.

To address those concerns, Gov. Martin O’Malley (D) and the leadership of the House and the Senate have backed proposed legislation that would create a new pretrial services division in the executive branch that would use statistical analysis to determine whether an arrestee should be confined pending trial or immediately released.

Supporters said the new division — which would start as a pilot program — would replace Maryland’s unusual two-tier system of setting bail that relies on court commissioners and judges and eliminate the need to provide public defenders to indigent defendants at each step of the process.

Sen. Brian E. Frosh (D-Montgomery), who has been leading efforts to craft a solution, argued that the new data-reliant approach would more fairly determine who should be released while also saving the state money compared to other alternatives intended to satisfy the court’s rulings.

“That particular tool has great predictive ability,” Frosh said. He said other jurisdictions that use such an approach, including the District of Columbia and Kentucky, release more people following their arrest and yet also report that fewer of those defendants fail to appear in court later or commit additional offenses while awaiting trial. Instead of releasing only about 44 percent of the state’s nonviolent defendants after their arrest for minor offenses, the new system might likely free about 50 percent, Frosh said.

As amended by the Judicial Proceedings Committee, Frosh’s bill would set up the new pretrial services agency as a pilot program in several counties. It would also require District Courts to operate six days a week instead of five days a week now. Citing administration figures, Frosh said the agency would cost about $16 million a year compared with estimates of as high as $55 million to comply with the DeWolfe v. Richmond rulings.

But Zirkin and other critics challenged the cost estimates, saying they were based on uncertainties and likely too low. They also argued that Frosh’s proposal and the Court of Appeals’ rulings have created an absurdity: in the name of broadening a defendant’s right to a fair bail hearing before a judicial officer with an attorney present, the state is instead considering entrusting those decisions to a computer operated by the executive branch.

“A machine doesn’t trigger the right to counsel?” asked Sen. James Brochin (D-Baltimore County).

Under Maryland’s current system, defendants have a right to appear before a judicial officer — usually a court commissioner — within 24 hours of their arrest. About half are released without having to post a bond. But some 80,000 defendants a year appear before both a District Court commissioner, who are on call at all times, and then a District Court judge for similar proceedings to review the criminal charges and possibly obtain bail.

Zirkin (D-Baltimore County) asked the Senate to suspend procedural rules to introduce the proposed amendment, SB1114, after the usual deadline for introducing new legislation and to send it directly to the Judicial Proceedings Committee for further action.

To amend the state constitution, a measure must pass each chamber of the legislature by a three-fifths majority and then be submitted to voters at the next general election.