Sometimes doing good can also mean doing well, even when it comes to revenue.

Ropes & Gray LLP acted on a pro bono basis as co-counsel in a class action alleging that New York City prisoners at Rikers Island were subject to an excessive use of force. Now that the case has settled, the firm will receive a share of $6.5 million in attorneys’ fees. Rather than adding its portion to its coffers, however, the firm plans to use the proceeds on other pro bono matters.

The settlement fees don’t come close to approximating those amassed, since the Ropes & Gray lawyers involved — including litigation partner Bill Sussman, government enforcement partner Chris Conniff and government enforcement associate Anna Friedberg — clocked more than 30,000 hours on the case since it was filed in 2012, the firm said in the statement.

No matter. With its share, Ropes & Gray will fund a counsel position at the Prisoners’ Rights Project, donate to The Legal Aid Society of New York, create a fellowship at Equal Justice Works in New York and dedicate funds to pro bono initiatives at the firm. It will also use some of the money to cover its expenses.

The settlement — announced in June but filed with the court for approval July 1 — requires new procedures to reduce violence and ensure the safety of inmates. They include the installation of video cameras, a pilot program for body cameras and the appointment of an independent monitor.

Ropes & Gray was co-counsel with the Legal Aid Society of New York Prisoners’ Rights Project and the law firm Emery Celli Brinckerhoff & Abady, along with the U.S. Attorney’s Office for the Southern District of New York.

The case is Nunez v. City of New York, 1:11-cv-05845, U.S.

District Court for the Southern District of New York (Manhattan).