THE young man who purportedly discovered Libya's Muammar Gaddafi hiding in a drainage pipe nearly a year ago has died of injuries after being kidnapped, beaten and slashed by the late dictator's supporters.

The death yesterday of Omran Shaaban, who had been hospitalised in France, raised the prospect of even more violence and score-settling, with the newly elected National Congress authorising police and the army to use force if necessary to apprehend those who abducted the 22-year-old and three companions in July near the town of Bani Walid.

Libya is battling lingering pockets of support for the old Gaddafi regime, and its government has been unable to rein in armed militias in a country rife with weapons. Earlier this month, a demonstration at the US consulate in the eastern city of Benghazi turned violent, killing four Americans, including the US ambassador.

Shaaban was praised as a "dutiful martyr'' by the National Congress, although his family says he never received a promised reward of 1 million Libyan dinars ($A773,432) for capturing Gaddafi on October 20, 2011, in the former leader's hometown of Sirte. The eccentric dictator was killed later that day by revolutionary fighters.

The Libyan government said it would honour Shaaban with a funeral befitting a hero. His body was greeted at the airport in his hometown of Misrata by more than 10,000 people for a procession to a soccer stadium for funeral prayers.

Omran ShaabanSource:AFP

Photos on social media websites showed a wooden coffin with a glass window that revealed Shaaban's face, with white gauze covering his head.

In the capital of Tripoli, several hundred protesters gathered outside the headquarters of the National Congress to demand that the government avenge Shaaban's death.

Shaaban's family said that he and three friends had been on their way home to the western city of Misrata from a vacation in July when they were attacked by gunmen in an area called el-Shimekh near Bani Walid.

Shaaban and his friends, who like many Libyans were armed, fired back, the family said.

Two bullets hit Shaaban, and he was paralysed from the waist down, his relatives said. The men were captured by militiamen from Bani Walid, a town of about 100,000 people that remains a stronghold of Gaddafi loyalists and is isolated from the rest of Libya.

President Mohammed el-Megarif visited Bani Walid this month and secured the release of Shaaban and two of his companions. A fourth is still being held.

When Shaaban was finally brought home, he was "skin and bones'' - still paralysed, frail and slipping in and out of consciousness, according to his brother, Abdullah Shaaban.

"It was clear he was beaten a lot,'' Abdullah Shaaban said. ``His entire chest was sliced with razors. His face had changed. It wasn't my brother that I knew.''

Omran Shaaban later was flown to France for medical treatment.

Shaaban, the second youngest in a family of nine children, was a member of Libya Shield, a loose coalition of the country's largest militias relied on by the Defence Ministry.

Libya's president released a statement today vowing that those responsible for the violence against Omran Shaaban would be punished.

But apprehending and disarming the militants in Bani Walid are among the most daunting tasks facing the government. The town is heavily armed with rocket-propelled grenades, automatic weapons and artillery left over from last year's civil war.

Residents of Bani Walid say that pictures of Gaddafi are displayed during weddings and youths play his speeches on their cars' stereos. Students refrain from singing Libya's new national anthem and teachers refuse to follow the revised curriculum.

Bani Walid fighters were blamed for many of the sniper attacks, shelling, rapes and other violence against the city of Misrata during the civil war, and there were new calls on yesterday from residents of Misrata for vengeance against Bani Walid.

Shaaban's eldest brother, Walid, insists there will be justice for the family, regardless of whether the government is the one to administer it.