Lebanon's justice minister has announced two arrests after video emerged showing guards beating detainees at Roumieh, the country's largest and most infamous prison.

Ashraf Rifi pledged on Sunday to carry out a full investigation into the case, saying the behaviour documented in two videos that began circulating online on Saturday was "a crime against the nation and humanity".

"We will see through an investigation until the end. This crime cannot go unpunished," he said.

"Two of the perpetrators have already been arrested."

The two videos, apparently filmed on mobile phones, appear to show guards at the prison humiliating detainees and beating them with plastic pipes.

Report: Claims Denmark outsourced its torture to Lebanon

In one video, a prisoner lies on a floor covered in water, stripped to his underwear with his hands tied behind his back.

He is asked what he is accused of, and replies "transporting terrorists".

A guard then beats him repeatedly with a green pipe, while another man off-camera encourages him and demands that the prisoner kiss his assailant's boot.

In the other video, about a dozen prisoners, all stripped to their underwear with their hands tied behind them, are seated on a floor.

A guard can be seen beating at least two prisoners, shouting at one: "Lower your voice or I'll put your eyes out."

Overcrowded prison

Roumieh is Lebanon's largest prison and has long been infamous for the poor conditions in some of its blocks, including overcrowding and harsh treatment.

Other parts of it, however, have at times become virtual no-go zones for security, with prisoners running their affairs and able to access laptop computers, phones and money.

In January, security forces raided the B block where many prominent fighters were being held, accusing some detainees of ties to a double suicide bombing in the northern city of Tripoli.

In April, some of the prison's inmates rioted and clashed with guards before the situation was brought under control.

Nuhad Mashnuq, Lebanon's interior minister, said on Sunday that the video appeared to have been filmed during that incident.

In remarks on Sunday, he said those involved would be held accountable.

"We will take all necessary measures against those involved and we will not allow violence against prisoners under any circumstances," he said.

Outsourcing torture

Al Jazeera has been doing its own unearthing of torture in Roumieh, using videos and pictures given to the network by prison inmates.

Several inmates and lawyers who spoke to Al Jazeera confirmed that prisoners are not only tortured but also kept under inhuman conditions in the jail.

Fayez Abadan, a prisoner serving a 15-year sentence who spoke to Al Jazeera via Skype, said vicious beatings, isolation and torture are routine inside the jail.

Interactive: Enemy of the state

Ali Ibrahim, a former prisoner, described in detail the gruesome torture to which he was subjected.

"I am lucky. Others were raped," he told Al Jazeera.

Ibrahim described in detail one of the methods of torture called Cat, Rat and Sleeping bag.

The Lebanese Center for Human rights told Al Jazeera that torture in Lebanon is endemic. Moreover, it is part and parcel of the process of interrogation of prisoners, especially political prisoners.

The rights organisation's Wadi al-Asmar told Al Jazeera that torture is considered an investigation tool - a way of extracting information.