Libya's transitional authority on Tuesday named Yousef al-Manqoush, a retired general from a bastion of rebels who overthrew Muammar Gaddafi, as the new armed forces chief in the first significant move to build a new Libyan military.

The appointment was announced as four fighters were killed in a gunbattle between rival militias in Tripoli on Tuesday, underlining the new government's struggle to control the increasingly fractious groups who toppled Gaddafi.

To help reinstate law and order, the interim government plans to include thousands of former rebels in the military, police and other civilian jobs. Some militia chiefs say they would only cede command of their fighters if an organised military and security apparatus were in place.

Manqoush's appointment by National Transitional Council chairman Mustafa Abdel Jalil could pave the way toward forming a structured military. But it is not clear yet whether he would be accepted by militia commanders as the head of the armed forces.

His prospects could be boosted, however, by the fact that he hails from Misrata, home to a number of powerful militias that helped topple the Libyan dictator.

Manqoush's Misrata connection could have been a major driver in the decision to choose him since the new defence minister, Osama Al-Juwali, comes from Zintan, another major militia base.

Manqoush is a retired army general who joined the insurgency that ended Gaddafi's 42-year rule in August and also now serves as the deputy defence minister, said an NTC official who asked not to be named.

He's a military officer who chose to retire. He joined the front lines early in the revolution, was arrested by Gaddafi forces and then was released by the revolutionaries.

Real power in Libya remains in the hands of militias more than two months after rebels captured and killed Gaddafi. They have carved up the capital and country into competing fiefdoms, each holding out for the share of power they say they are owed.

(Editing by Mark Heinrich)