Demonstrators have attacked or broken into the General National Congress (GNC) building several times in the past, either trying to force the adoption of laws or to air other grievances.
"We heard the shots before the bullets hit the front of the building," the congresswoman said on condition of anonymity.
Demonstrators calling for a vote of no confidence in Prime Minister Ali Zeidan's government fired the shots, she added.
Security personnel helped lawmakers to evacuate the building.
Also Read
Zeidan has been repeatedly criticised for his government's failure to tackle the instability that has plagued Libya since the ouster of dictator Moamer Kadafi in October 2011.
The embattled premier said today he would resign if the GNC came to a consensus on a successor, warning of a power vacuum if he left his post without one.
Zeidan was himself briefly abducted by militia last year, highlighting the persistent lawlessness.