Maryland’s highest court voted unanimously Tuesday to restore the names of police officers to a statewide database of court records and for the fix to take place by the end of the week.

The judges moved quickly to reverse a controversial decision that had blocked online public access to information previously available about arresting officers and the names of other law enforcement officials involved in criminal cases. The change was criticized by lawyers, civil rights advocates and journalists who rely on the database to look for patterns of misconduct and to hold police accountable.

“We are accountable. We will address this error,” Chief Judge Mary Ellen Barbera said before the Court of Appeals voted to put back the names of police officers.

“Sometimes small mistakes can have big consequences, and that’s what happened here.”

The seven-member court signed off on stripping out the officers’ names last June at the recommendation of an advisory committee and said last week that the policy came in response to concerns about the safety of members of law enforcement.

But on Monday, the head of the committee said the decision to delete was all a mistake. The court scheduled Tuesday’s unusual emergency hearing to reconsider the policy.

“It was an honest mistake, not for any improper motive, but a mistake that never should have occurred, and for which I humbly apologize,” the judiciary’s rules committee chairman, Alan M. Wilner, a former appeals court judge, said Monday. He attended Tuesday’s meeting.

His 30-member advisory committee includes judges, attorneys, prosecutors and state legislators. A spokeswoman for the judiciary said there was no record of which members voted in favor of the new rule.

The policy became official in August but did not take effect until last week, “after the necessary re-programming and testing of the site,” the court said.

Before the change, the public could search online to pull up a list of cases involving particular officers. Since the change, first reported by the Baltimore Sun, the names of officers are no longer available online. The ­information is accessible on some courthouse computers or in ­paper case files.

Cary Hansel, a civil rights lawyer in Baltimore, was among the attorneys, academics and community activists who urged the court Tuesday to ensure public access to the full names of arresting police officers. He called the prospect of leaving the rule in place “frightening.” People who believe they have been subjected to false arrest or excessive force by the police may be too traumatized, he said, to get the names of the officers.

“This is a critical tool for civil rights advocates to use in policing the police, and without it we lose the type of transparency necessary to do our jobs,” Hansel said.

Amy Petkovsek of Maryland Legal Aid told the judges the deletion of officers’ names was affecting hundreds of low-income residents. Her clients are having trouble getting jobs because of online arrest records even in cases that did not lead to convictions. To complete the formal process to have those online references removed, an individual needs to know the names of arresting officers, Petkovsek said.

After the vote at the public hearing to revert to the earlier system, Hansel and Petkovsek praised the court for its rapid response to concerns.

In Virginia, the state Senate in 2016 approved a measure that would have kept secret the names of police officers and fire marshals by classifying the information as “personnel records.” The legislation failed in the House.

The decision in Maryland to remove officers’ names from the online database came as the police department in Baltimore struggled to overcome allegations of widespread corruption. Members of an elite police task force have been implicated in a conspiracy, and thousands of convictions in cases handled by the unit are being re-examined by defense lawyers.

In explaining the new policy last week, the judiciary said in a statement that the rules committee approved it only after holding a public meeting and posting information about the coming changes on the court’s website.

The judiciary is “committed to balancing the public’s interest in access to court information with our equally important obligation to protect personal identifying information from potential misuse,” the statement said.

Police in Anne Arundel County initially pressed for a change, but only for removal of officers’ first names — consistent with other court documents that display an officer’s rank, first initial and last name, according to department spokesman Lt. Ryan Frashure. The committee went further, striking the full names, office address, phone number and email address of officers. The database contains the names of prosecutors, defense attorneys and judges.

Wilner, the committee chairman, told the Court of Appeals in a letter Monday that he could not immediately provide a full accounting of how the previous language allowing access to officer information was deleted. The vote on Tuesday immediately restores the section that was removed. State court administrator Pamela Harris told the judges that the full names could be back in the system by Friday.

The database, known as Case­Search, was created in 2006. Wilner said initial concerns about it surfaced during the 2016 General Assembly session and appeared to get tangled up in committee discussions about other proposals for rules governing the database.

The deletion of the language on officer names, Wilner wrote, “should have been caught, and, had it been, the current problem would not have arisen.”

After the hearing Tuesday, Wilner described the deletion of the language as a “procedural error” that was the result of a long, contentious meeting. The committee considered changing full names to officers’ first initials, but never intended to completely wipe them from the system.

“We just missed it,” he said.