OAKLAND — The Oakland Police Department on Thursday acknowledged that in 25 cases the Oakland Police Department wrongly denied visa applications to immigrants who were victims of a crime and eligible for a form of witness protection.

The errors were found after the department conducted an internal audit over the past week. Initially, Oakland police Chief Anne Kirkpatrick said the office of Alameda County Public Defender Brendon Woods identified two cases and brought them to her attention last week.

Figures provided by the department show nearly 300 denials occurred over the past two years, a sharp increase from previous years. The department is now asking anyone whose application was denied to contact OPD.

“We have not been fully and squarely within the law,” Chief Kirkpatrick said this week. “We want our community to know if they are a victim of a crime they can come to us.”

The largely unknown program allows victims of certain crimes who have suffered mental or physical abuse to apply and obtain a visa after Congress in 2000 passed the Victims of Trafficking and Violence Protection Act. Applicants are first certified by the law enforcement agency where the crime occurred and approved by the federal government, a process that can take years due to a large and growing waiting list.

Qualifying crimes include rape, sexual assault, kidnapping, murder, human trafficking and domestic violence. The special visa allows people who assist law enforcement in investigations to live and work in the U.S. for up to four years. A California law that took effect in January 2016 also required state and local law enforcement agencies to certify the helpfulness of immigrant crime victims.

Public Defender Woods could not be reached for comment.

In one of the two Oakland cases identified by Woods, the victim was facing a deportation proceeding which under the law requires a certification within 14 days. Typically a person must be certified within 90 days of the request.

The issue in Oakland arises at a time of controversy surrounding the city’s sanctuary city status and the police department’s role directing traffic during an August Immigration and Customs Enforcement raid at a home in West Oakland, in which two men were detained. An internal affairs complaint was filed against Kirkpatrick by Brian Hofer, the chair of the city’s privacy advisory commission.

Last week, the City Council formally voted to terminate an agreement with ICE which allowed police to take part in ICE task forces, as reports surfaced that the federal government planned to conduct raids in the Bay Area. ICE Deputy Director Thomas Homan publicly criticized the vote in a statement saying it is “wrong and deeply offensive to impugn the integrity of the thousands of men and women law enforcement officers of ICE by accusing them of being racists, harassers, and underminers of the judicial system — all for doing their sworn duty to enforce the law.”

While top Oakland police officials admitted two U-Visa cases were wrongly denied, one immigration attorney said the city is among the most prolific in certifying them, only second to Los Angeles.

Susan Bowyer of the Immigration Center for Women and Children in Oakland, who has helped advise the city of changes in the program, said Oakland certifies more U-Visas per capita than any other city. In part, that is due to the city’s immigration population and crime rate.

However, Bowyer said she has heard of complaints since a state law was passed in 2016 that allowed people with criminal histories to be eligible for the visa if they were a victim in another case. Bowyer said many jurisdictions were not up to speed on the law and officers in some cases have been reluctant to certify a victim if it isn’t clear the crime qualifies under the law.

Nationally, 25 to 30 percent of certified applications are denied by the federal government, she said.

“The people who have had them denied have gotten pretty frustrated,” Bowyer said. “They see the law here and that (certain departments) are not following it. San Francisco is as good and sometimes even a little more generous than Oakland. We work with a lot of jurisdictions but Oakland and San Francisco are among the top.”

According to department figures, Oakland received 940 applications in 2017, certified 796, and rejected 144. The city certified more than 1,000 applications in each of the previous five years. The figures show a spike in rejections: in 2014, only eight of 1,622 applications were rejected, and in 2013, none of the 1,108 applications were rejected.

By comparison, the Alameda County Sheriff’s Office averages about 70 requests a year and in 2017 certified 59 and rejected 10, according to Cmdr. Don Buchanan. A 2014 report by Reuters ranked cities on the special visa, with Los Angeles issuing 4,585 between 2009 and 2014 and San Jose issuing 1,430 over the same period.

Lt. Jill Encinias of Oakland’s special victims unit said she is now looking through all the rejections to see if any others were done in violation of the law. Encinias, who along with her sergeants certifies the applications, said the reasons for rejections could include wrong information on the application or that the crime was determined to not have occurred. The city won’t know how many were wrongly rejected until after its audit is completed, Encinias said.

She encouraged anyone who had their application denied to call her at 510-238-3253.

In a statement, Justin Berton, a spokesman for Mayor Libby Schaaf, said the police department “was quick to recognize the error and quick to fix it.”

“The most important message is that our immigrant community in Oakland knows that they are safe to re-submit their certification and encouraged to do so,” he said.