When a rebellion rose against the Qaddafi government in 2011, prompting the intervention of the United States and NATO, Mr. Hifter returned to Libya, building up a powerful faction.

In 2014, with an interim government in place after Colonel Qaddafi’s death, Mr. Hifter and his forces launched a broad offensive in Benghazi, Libya, called Operation Dignity, aimed at routing out extremist Islamic militants. Mr. Hifter’s two sons, Khalid and Saddam, served as officers under him and led fighting in Benghazi.

During an offensive that October, two families got caught up in the violence.

In the lawsuit, the plaintiffs said that Mr. Hifter’s forces captured the Suyid family home. When the father, Adel Salam al-Suyid, and his son, Ibrahim, rushed home to rescue other family members, they were captured and kidnapped. The next day, their bodies were discovered bearing injuries that showed they were tortured.

Two days later, other forces under Mr. Hifter’s command attacked the Krshiny home, killing two family members. Six brothers from the family were taken prisoner, accused of being members of the Islamic State. Ibrahim al-Krshiny, already injured in the eye from the attack on the house, was stripped and then beaten about the head with pipes, cables and a broomstick, according to the lawsuit. Then, over the next seven and a half hours, he was subjected to electric shocks.

Mr. al-Krshiny was eventually released but lost an eye as a result of the abuse, according to his lawsuit. His brother Mustafa’s body was found days later, his hands tied behind his back and bullet holes in his head and chest. Another brother, Ali, was also shot to death, and three others were wounded.

“In October 2014, 10 men from these families were imprisoned, beaten, electrocuted or shot by Hifter’s forces,” said Kevin Carroll, a lawyer with Wiggin and Dana who represents the families. “These families will not receive due process in a country largely controlled by Hifter.”

The lawsuit accuses Mr. Hifter and his sons of using the Libyan National Army to wage “an indiscriminate war against the Libyan people,” torturing and killing hundreds without any judicial process.