TRIPOLI, Libya — A car bomb tore through a Libyan Foreign Ministry building in the eastern city of Benghazi on Wednesday, a powerful reminder of lawlessness in the North African nation on the first anniversary of a deadly attack on the US consulate there and the 2001 terror attacks in the United States.
Prime Minister Ali Zidan issued a stern warning to militias blamed for much of the violence that has plagued Libya since the overthrow of dictator Moammar Khadafy two years ago.
“We will not bow to anyone,’’ the prime minister said.
But the challenges are mounting. Zidan said that armed men had just stormed a post office in Tripoli, taking employees hostage. A witness at the scene, speaking on condition of anonymity because of security concerns, said the attackers were seeking to cut off mail to the southern city of Sabha in retaliation for a rival tribe from Sabha cutting off the water supply to Tripoli for a week.
Other groups have shut down oil fields to protest corruption or demand regional autonomy, causing the country to lose out on millions of dollars a day in potential revenue.
The Benghazi blast caused no deaths or serious injuries, but it destroyed the Foreign Ministry building in an attack rich in symbolism. The building once housed the US Consulate under the rule of King Idris, who was overthrown in 1969 in a bloodless coup led by Khadafy.
The bombing took place about 6 a.m., well before anybody was due to arrive for work and at a time when the nearby streets were empty.
The explosion blew out a side wall of the building, leaving desks, filing cabinets, and computers strewn across the concrete rubble. It also damaged the Benghazi branch of the Libyan Central Bank.
Pictures circulated on Facebook show men carrying dead doves, with one person commenting, ‘‘The dog who did this will be punished for the guilt of killing doves.’’
Another photo shows black smoke smoldering out of the charred Foreign Ministry building, along with wrecked cars and burned palm trees. A green tarp was later placed over part of the building.
The blast also rocked Benghazi’s main boulevard, Gamal Abdel-Nasser, which runs through the city from north to south.
Mohammed el-Ubaidi, head of the Foreign Ministry branch in Benghazi, told Libyan television that the car carried 132 pounds of explosives and was blown up by remote control.
No group immediately claimed responsibility for the attack, which came a day after bomb disposal experts defused an explosive device found next to the Foreign Ministry headquarters in Tripoli.
‘‘There is a force that doesn’t want a state in place and wants to turn Libya into a battlefield of terrorism and explosions,’’ Zidan said. ‘‘The security situation is tough.’’
Khadafy was deposed and killed in 2011, after an eight-month uprising that descended into a civil war. Since then, successive Libyan interim governments have failed to impose law and order. The country remains virtually held hostage by militia forces initially formed to fight Khadafy. The militias, which have huge stockpiles of sophisticated weaponry, now threaten Libya’s nascent democracy.
Car bombings and drive-by shootings routinely kill security officials in Benghazi, the birthplace of the uprising.
Deputy Interior Minister Sadik Abdel-Karim described the security situation as deteriorating.
Tawfiq Breik, a lawmaker with the liberal-leaning National Forces Alliance, said the attacks will continue as long as Libya lacks a strong national army and police.
‘‘Even with so many officials assassinated, no one is held accountable,’’ Breik said. ‘‘No one is arrested. The state is disabled.’’
Ashour Shwayl, a former interior minister, concurred.
‘‘There is no solution but for the police, military, and judiciary to be built up,’’ he said. ‘‘Otherwise, chaos will remain.’’
But the government has been mired in political paralysis, fueled by rivalry between a Muslim Brotherhood-led bloc of Islamists and a liberal-leaning bloc following successful parliamentary elections last year.
The two sides have been unable to organize an election of an assembly tasked to write a new constitution, causing the liberal-leaning bloc last month to suspend its participation in the process.
Moreover, Libya has had no interior minister since the last one resigned weeks ago over a conflict with the prime minister.
The United States condemned Wednesday’s car bombing. State Department spokeswoman Jen Psaki said ‘‘The attack threatens to undermine Libya’s democratic transition as well as the legacy of Libya’s revolution in which the Libyan people made their voices heard through peaceful means.’’
The bombing came exactly one year after militants linked to Al Qaeda stormed the US mission in Benghazi and a nearby building, killing US Ambassador Chris Stevens and three other Americans.
‘‘We can’t ignore the date and timing,” Zidan said. “We can’t forget.”
Last year’s attack sparked widespread criticism of President Obama and his administration for failing to protect the diplomats and for mishandling a subsequent investigation.
The United States closed 19 diplomatic posts across the Muslim world for almost a week last month out of caution over a possible Al Qaeda strike — probably in response to the Benghazi criticism.