Demonstrators broke into Libya's Parliament in Tobruk and set a fire in front of the building to protest against the country's warring political parties and to demand better living conditions, witnesses told international news agencies.
“We want the lights to work,” protesters chanted.
Security forces protecting the building withdrew from the site, the witnesses added.
Demonstrations took place on Friday in Tobruk, Tripoli, Benghazi and some smaller towns over the perceived failure of the government to solve the country's problems.
Libya has been in crisis since the 2011 uprising that ousted Muammar Qaddafi. In 2014, it split between warring eastern and western factions before a 2020 peace process tried to knit the country back together.
Despite international efforts, however, the country remains divided. Libya's House of Representatives remains based in Tobruk, hundreds of kilometres to the east of the capital Tripoli, since the 2014 east-west schism, while a rival body, formally known as the High Council of State, is based in Tripoli.
In Tripoli's Martyrs' Square, several hundred people gathered to shout slogans demanding electricity, criticising armed factions and politicians and demanding elections in the capital's biggest protests against the ruling elite for years.
Later on Friday, dozens of protesters stood by the government headquarters building, chanting "we want electricity, we want electricity".
Several television channels said that protesters in Tobruk, tired of the high-level bickering, had managed to penetrate the building where they committed acts of vandalism. Media outlets showed images of thick columns of black smoke coming from its perimeter as angry protesters burned tyres.
Images showed a protester driving a bulldozer had managed to smash through part of a gate, allowing other demonstrators to enter more easily, while officials' cars were set on fire.
The building was empty at the time of the protest.
Libya has endured several days of power cuts, worsened by the blockade of several oil facilities against the backdrop of political rivalries.
Presidential and parliamentary elections, originally set for December last year, were meant to cap a UN-led peace process following the end of the last major round of violence in 2020.
But the vote never took place due to several contentious candidacies and deep disagreements over the polls' legal basis between rival power centres in the east and west.
After the halted election, the House of Representatives said the interim unity government of Abdul Hamid Dbeibah had expired and it appointed Fathi Bashagha to replace him.
The UN said on Thursday that talks between the rival Libyan institutions aimed at breaking the deadlock had failed to resolve key differences.
Parliament speaker Aguila Saleh and High Council of State president Khaled Al Mishri recently met at the UN in Geneva for three days of talks to discuss a draft constitutional framework for elections.
While some progress was made, it was not enough to move forward towards elections, with the two sides still at odds over who can stand in the presidential elections, said the UN's top Libya envoy Stephanie Williams, who organised the talks.
Ms Williams condemned the attack on the Libyan parliament in a post on her Twitter account, saying that while people had the right to protest, "riots and acts of vandalism such as the storming of the House of Representatives headquarters late yesterday in Tobruk are totally unacceptable".