CAIRO — Armed men Tuesday shot dead a lawyer and activist who was a vocal critic of authorities in eastern Libya, security and judicial officials said.

The men, who were masked, attempted to kidnap Hanan al-Barassi on a busy street in the eastern city of Benghazi but ended up killing her, according to security authorities in a statement.

The statement said the killers fled and that an investigation was opened. The Justice Ministry in eastern Libya condemned the killing and vowed to bring those responsible to justice.

No group immediately claimed responsibility for al-Barassi's killing.

Benghazi is the largest city in eastern Libya, which is under control of forces loyal to military commander Khalifa Hifter. The oil-rich country is split between rival administrations based in Benghazi and the capital Tripoli, each backed by armed groups and rival foreign governments.

The lawyer was known for livestreaming on social media platforms, revealing alleged corruption of security and military officials. Amnesty International condemned the killing and said al-Barassi and her daughter had received death threats.

A day before her death, the activist said on her Facebook page that she would reveal alleged corruption by Hifter's son, Saddam, Amnesty said.

The rights group called on Hifter's forces to investigate the killing and hold those responsible accountable.

Several rights activists, journalists and dissidents have left conflict-stricken Libya in recent years after they were threatened, assaulted or arbitrarily detained.

In a 2018 report, Amnesty said women who dare to speak out against corruption, the predations of the militias or Hifter's forces have suffered from "specific, gender related risks" or smearing in social media campaigns.

The U.S. Embassy in Libya in a statement condemned "this brazen killing" of al-Barassi, who was "a vocal attorney who actively sought to fight corruption in Libya."

Proliferation of weapons and armed gangs continue to threaten the country's security since the 2011 NATO-backed popular uprising toppled and killed longtime dictator Moammar Gadhafi.

Also on Tuesday, a militia in Tripoli allied with the U.N.-supported government released Mohammed Baio, head of the state-run media office, after three weeks in detention, Baio said. He did not elaborate.

The militia, known as the Tripoli Revolutionaries Brigade, had detained Baio after he ordered state-run television stations and media outlets to "stop airing and publishing materials related to the civil war."

Baio posted a photo of himself at home, saying his detention was a result of "misunderstanding" with the militias that helped repel Hifter's attack on Tripoli.

The militias have accused Baio of being a Gadhafi loyalist and have pressured the U.N.-supported government to sack him.