Libya's prime minister, who was recently approved in a contested parliamentary vote, was unharmed in an attack on his home that set off a gun battle with guards, a government official said.

The official said that four attackers fired rocket-propelled grenades at the house of Ahmed Maiteg early on Tuesday, sparking clashes with security guards.

One of the assailants was killed and another was arrested while the rest fled, the official said, speaking to Al Jazeera's Stefanie Dekker in Tripoli.

"The latest attack highlights the lawlessness and security concerns in Libya, and that the militias are in charge here," said our reporter.

She added that Maiteg was officially named prime minister late on Monday.

The appointment escalated a political crisis pitting lawmakers and fighters against forces loyal to General Khalifa Haftar, who has launched an armed campaign to try to restore order, three years after the revolt that toppled and killed Muammar Gaddafi.

Thousands of Libyans have held demonstrations in recent days demanding the elected assembly halt sessions and accusing it of financing armed groups and acting as their political wing.

Hardliners have condemned the offensive launched earlier this month as a "coup," while several prominent government officials, diplomats and military units have rallied to Haftar's cause, hoping he can bring stability to the petroleum-rich North African country.

Many of the heavily armed rebel brigades that defeated Gaddafi's forces three years ago have since been transformed into militias that refuse to disarm or join the national security forces.

They have been blamed for a string of kidnappings and assassinations of diplomats, government officials, activists, judges, and members of police and army.

Source: Al Jazeera And AP