As forces loyal to Libyan leader Muammar Gaddafi retreat from Tripoli, they have left a trail of evidence about how his regime operated.
The BBC's Orla Guerin gained access to Gaddafi's homeland security headquarters and found hundreds of secret files.
These documents show how much the regime was able to monitor the rebels' progress.
The BBC crew also found operational charts about tracking anyone with a mobile phone, anywhere in the country, and guides on identifying new potential suspects.