The British broadcaster said members of the three-person team were pummeled with fists, knees and rifles, had hoods placed on their heads and were subjected to mock executions by Libyan troops and secret police.
The three journalists were held for 21 hours after being detained Monday, but since left Libya, which has descended into a civil war between Gadhafi troops and rebels seeking an end to the leader's four-decade rule.
In a statement, the BBC said it condemned the "abusive treatment" of its journalists.
"The safety of our staff is our primary concern especially when they are working in such difficult circumstances and it is essential that journalists working for the BBC, or any media organization, are allowed to report on the situation in Libya without fear of attack," Liliane Landor, languages controller of BBC Global News, said in the statement.
The BBC Arabic Service team presented their identification when they were detained at an army roadblock on Monday. The three were taken to a military barracks in Tripoli, where they were blindfolded, handcuffed and beaten, the BBC said. They were told the Libyan government did not like their reporting of the fighting.
One of the three, Chris Cobb-Smith, said they were lined up against a wall.
"I looked and I saw a plain-clothes guy with a small sub-machine gun. He put it to everyone's neck. I saw him and he screamed at me," Cobb-Smith said. "Then he walked up to me, put the gun to my neck and pulled the trigger twice. The bullets whisked past my ear. The soldiers just laughed."
All three members of the BBC crew said they saw evidence of torture against Libyan detainees while they were in the military facility.
"I cannot describe how bad it was," said cameraman Goktay Koraltan. "Most of (the other detainees) were hooded and handcuffed really tightly, all with swollen hands and broken ribs. They were in agony. They were screaming."
A senior Libyan government official later apologized for the BBC team's ordeal.
Notable deaths of 2014 [PHOTOS]