Car bombs went off outside the Egyptian embassy and that of the United Arab Emirates in the Libyan capital on Thursday, causing some damage to the buildings, long-shuttered in the wake of the violence roiling Tripoli, officials said.

No one was hurt in the near-simultaneous explosions that rocked the city's upscale neighborhood housing foreign missions, said the official, speaking on condition of anonymity because they were not authorized to talk to media.

Both the Egyptian and the Emirati embassy, along with most diplomatic missions, foreign and international organizations have been closed for months as Islamist-allied militias seized Tripoli after weeks of fierce fighting.

Egypt condemned the attack, saying it harmed the "historic, blood ties" between the two nations. "Terrorist groups are using violence to reach political goals," Egypt's Foreign Ministry said in a statement.

The blasts occurred a day after three car bombs, including one driven by a suicide attacker, struck in the eastern Libyan cities of Tobruk and Bayda where the nation's elected parliament and government are temporarily housed. Six people died and 21 were wounded in those bombings. Initial reports said five people were killed but a person wounded in one of the blasts later died of the injuries.

Libya has descended into what has been the country's worst bout of violence since dictator Moammar Gadhafi's ouster and death in 2011. The fighting has killed hundreds, displaced tens of thousands and forced foreign diplomats and organizations to leave the country.

The Islamist-allied militias, which have taken Tripoli and the country's second-largest city, Benghazi, accuse the UAE and Egypt of backing their non-Islamist rivals.

The militias' push into the two main cities and the fighting that engulfed much of the country has forced the elected parliament, dominated by non-Islamist lawmakers, and the government the house approved, to move to the Tobruk and Bayda, which had remained mostly quiet until the attacks Wednesday.