BAYDA, Libya — The battle for control of Libya threatened to break open its central bank on Thursday as fighters with one of the country’s two warring factions seized control of its Benghazi branch, risking an armed scramble for its gold reserves that could cripple the last functioning institution in the country.

The Central Bank of Libya is the great prize at the center of the escalating armed conflicts that have consumed the country since the overthrow of Col. Muammar el-Qaddafi more than three years ago. It has also been the main shield preventing Libya’s descent into utter chaos and deprivation.

The central bank is the repository for Libya’s oil revenue and holds nearly $100 billion in foreign reserves. A desire for a share of that wealth has helped motivate the violent competition among an array of militias fighting for money and influence. They have carved the country into warring fiefs, destroyed its two largest airports, bombed and shelled civilian neighborhoods and burned down refineries and oil depots — driving the oil output that is the mainstay of Libya’s economy down to less than 250,000 barrels a day from as much as 1.7 million a day at its peak.

As a result, Libyans across the country endure electricity blackouts for hours a day, long lines for scarce fuel at gas stations, and shortages of cooking oil despite its vast energy resources.