(Adds French denial of mercenaries, details from Tripoli, Sirte)
* Interim leaders struggle to form new administration
* Disorder and infighting among NTC soldiers
By Maria Golovnina and Alexander Dziadosz
BANI WALID/SIRTE, Libya, Sept 19 (Reuters) - France denied on Monday that it had mercenaries in Libya, after Muammar Gaddafi's loyalists said they had captured 17 foreigners -- some British and French -- in the fight for a town still held by the ousted leader's followers.
The claim by Gaddafi's spokesman Moussa Ibrahim that foreign security personnel had been captured in the battle for the pro-Gaddafi bastion Bani Walid could not be verified and no immediate proof was presented.
It comes as the new authorities are facing stark reversals on the battlefield and in the political arena.
Nearly a month after Gaddafi was driven from power, his loyalist holdouts have beaten back repeated assaults by National Transitional Council forces at Bani Walid and Gaddafi's home city of Sirte. NTC fighters have been sent fleeing in disarray after failing to storm Gaddafi bastions.
The NTC, still based in the eastern city of Benghazi, has faced questions about whether it can unify a country divided on tribal and local lines. A long-promised attempt to set up a more inclusive interim government fell apart overnight.
"A group was captured in Bani Walid consisting of 17 mercenaries. They are technical experts and they include consultative officers," Gaddafi spokesman Ibrahim said on Syria-based Arrai television, which has backed Gaddafi.
"Most of them are French, one of them is from an Asian country that has not been identified, two English people and one Qatari."
French Foreign Minister Alain Juppe, in New York to attend a U.N. meeting, told journalists: "We have no French mercenaries in Libya."
The British foreign office said it had no information about whether the report was true and Qatar's foreign ministry was not available for comment. NATO, which is staging air strikes on Gaddafi loyalist positions, says it has no troops on the ground in Libya.
Western nations have sent special forces in the past, and media have reported that private security firms have aided anti-Gaddafi forces in training, target ting and with leadership. Gulf Arab states have also sent trainers and arms.
Among the confirmed sightings of foreign security personnel in Libya during the conflict, the head of a French security firm was shot dead at a checkpoint in Benghazi in May, and British special forces troops were held for three days by rebels in March while escorting a spy trying to make contacts.
The interim government's attempts to seize Bani Walid, 150 km (95 miles) southeast of Tripoli have become a debacle, with forces repeatedly surging into the town only to be driven out by its pro-Gaddafi defenders.
On Monday, NTC forces were unable to approach the northern gate to attack the town because of heavy gunfire from Gaddafi loyalists.
Fighters said on Sunday their plans had gone awry for tanks and pickup trucks with rocket launchers to lead an attack. Foot soldiers piled in first, only to be driven out.
"There is a lack of organisation so far. Infantrymen are running in all directions," said Zakaria Tuham, a senior fighter with a Tripoli-based unit.
Many fighters spoke of tension between units drawn from Bani Walid itself and those from other parts of the country.
Some fighters openly disobeyed orders. In one incident, an officer from Bani Walid was heckled by troops from Tripoli after he tried to order them to stop shooting in the air.
NTC forces and NATO warplanes also attacked Sirte, Gaddafi's birthplace, where assaults have been repelled. Hundreds of families were fleeing the city on Monday as NTC forces rolled up with huge rocket launchers and artillery.
Humanitarian groups have voiced alarm at reported conditions in the besieged coastal city.
"There's no electricity, no phone coverage. Nothing," resident Ibrahim Ramadan said, standing by a car packed with his family at a checkpoint. Interim government forces were handing out juice to civilians and rifling through their belongings to search for weapons.
Residents said homes had been destroyed and cars smashed to pieces as disorder spread through the city.
"People are fed up. There are explosions going off everywhere and you don't know where the bullets will come from next," said Abubakr, a resident making his way out of the city.
"Look at this," he said, pointing to a bullet hole in his windshield. "Bullets are coming down from above. People are just firing randomly."
In Benghazi, interim Prime Minister Mahmoud Jibril failed to name a new cabinet on Sunday when his proposals did not receive full backing from all current members.
"We have agreed on a number of portfolios. We still have more portfolios to be discussed," Jibril told reporters at a news conference on Sunday.
Sources familiar with the negotiations said Jibril's own role had been a sticking point. There was also disagreement about whether it was right to form a transitional government before declaring Libya "liberated", which NTC officials say can only happen when all Gaddafi loyalists are defeated.
The political infighting reveals some of the fractures in an alliance that was united in civil war by hatred of Gaddafi but remains split among pro-Western liberals, underground Islamist guerrillas and defectors from Gaddafi's government.
The NTC has its roots in Libya's east, but most of the militiamen who finally succeeded in driving Gaddafi out of Tripoli are from towns in the west. Fighters are organised by home town into units with little overall coordination.
Nevertheless, many Libyans say they can tolerate confusion among the new rulers as the price of being rid of Gaddafi, who crushed all opposition during four decades of rule.
"The delay in the new government isn't important... We need time to recover," engineer Mustafa Saab bin Ragheb told Reuters in Tripoli's main Martyrs' Square, where traffic police in crisply pressed which uniforms took up patrols on Monday for the first time since Gaddafi's fall.
"Look, we finally got rid of that bloody monkey. We are better than before. We will hang him and his sons, and then we can breathe freely. It's too early for politics." (Additional reporting by John Irish in New York, William MacLean and Joseph Logan in Tripoli, Sherine El Madany east of Sirte, Emma Farge in Benghazi, Barry Malone and Sylvia Westall in Tunis and Juliane von Reppert-Bismarck in Brussels; Writing by Peter Graff; Editing by Giles Elgood)