In this June 26, 2018, file photo, then-Suffolk County District Attorney Democratic candidate Rachael Rollins, left, takes questions directly from inmates during a forum at the Suffolk County House of Correction at South Bay, in Boston. Credit: Steven Senne / AP

BOSTON — Boston’s top prosecutor was narrowly confirmed Wednesday by the full U.S. Senate to be the next U.S. attorney for Massachusetts, making her the first Black woman to hold the position.

Suffolk District Attorney Rachael Rollins was confirmed 51-50 along party lines, with Vice President Kamala Harris casting the deciding vote.

Some Republican senators had criticized her progressive approach to crime, most notably Arkansas Sen. Tom Cotton, who said she is soft on criminals and her approach leads to an increase in violent crime.

“Her confirmation as U.S. Attorney would put Americans in danger,” a spokesperson for Cotton said in an email in October.

Rollins, who is the top prosecutor for the city of Boston and the suburbs of Chelsea, Winthrop and Revere, responded to GOP criticism in a radio interview on GBH News, saying her approach, including her decision to not prosecute nonviolent, low-level crimes and to back police reform, is working and that violent crime is actually down in Boston.

Rollins also had letters of support from several law enforcement officials, including a number of former Republican U.S. Attorneys for Massachusetts.

In a statement Wednesday, Rollins said she was “honored and humbled” by the opportunity, and looks forward to applying what she called “data-driven, evidence-based approaches” on the federal level.

She said violent crime — including homicides — in her jurisdiction is down this year by more than 20 percent from the five-year average, at a time when most other major cities have experienced increases in violence.

“Every policy and initiative that I have put in place as Suffolk County District Attorney has been designed to improve the safety and well-being of the communities I serve, to improve the public’s trust in law enforcement and our courts and to improve the fairness and equity of the criminal legal system,” she said.

The confirmation process was long and contentious by Senate standards. A Senate Judiciary Committee hearing on her nomination in September ended in an 11-11 tie along party lines, forcing Wednesday’s unusual roll call vote.

Rollins, 50, is a former assistant U.S. attorney in Massachusetts and was elected in 2018 as the first woman of color to serve as Suffolk district attorney. A successor to complete her term, which ends in 2022, will be selected by Republican Gov. Charlie Baker.