|Fighters aligned with the National Transitional Council advance on the last strongholds of Muammar Gaddafi [EPA]
Muammar Gaddafi loyalists have killed 17 guards at an oil refinery outside the coastal town of Ras Lanuf in an apparent attempt to disrupt Libya's new rulers from seizing the ousted ruler's last bastions and revive the oil-based economy.
Hours after the attack on Monday the government of Niger confirmed to the United States that it had detained Gaddafi's son, Saadi, and is studying what to do with him, the US State Department said on Monday.
"We have confirmed with the government of Niger that Saadi crossed over [and] that they are either in the process or have already brought him to the capital of Naimey and intend to detain him," State Department spokeswoman Victoria Nuland told the Reuters news agency.
A Syrian-based television station that has broadcast messages from Gaddafi in the past said he was still in Libya, but it was unable to air a televised appearance for security reasons.
"It was meant to show the leader among his fighters and people, leading the struggle from Libyan lands, and not from Venezuela or Niger or anywhere else," Mishan Jabouri, owner of the Arrai channel, told viewers.
He read out a text quoting Gaddafi as saying: "We cannot give up Libya to colonisation one more time ... There is nothing more to do except fight until victory."
Al Jazeera's Hashem Ahelbarra, reporting from Tripoli, said: "This statement is considered a desperate PR stunt by Gaddafi saying that he is still in Libya and he still has suporters who will fight for him ... The feeling here among the NTC is that Gaddafi has lost the battle".
Even so, Libya's ruling National Transitional Council (NTC) says that as long as Gaddafi remains on the run he is capable of attracting followers to a dangerous insurgency - of the kind which the refinery attack might prefigure.
Despite Gaddafi's defiance, battles continued on the outskirts of Bani Walid, one of the last bastions of support for Gaddafi, as NTC fighters massed there for another day.
The continued advance on Bani Walid, and elsewhere on Sirte on Monday, came as China officially recognised the interim leadership.
"Revolutionary fighters, from where I am, are firing grad rockets while other people, defending Bani Walid, are firing back in the name of Colonel Gaddafi with artillery and mortar shells," said Al Jazeera correspondent Anita McNaught, reporting from the southeast of the city on Monday.
She continued: "There was the hope perhaps that today the big push to take us into Bani Walid from the south would have happened by now. But the entire battle seems to be intriguingly dysfunctional at the moment, with not ideal co-ordination either between fighting groups or between the north and south frontier."
McNaught said there was still resistance inside the town, with pro-Gaddafi fighters there estimated to number from 150 to 600.
Citing NTC fighters present during the attack on Ras Lanuf, Al Jazeera's Hoda Abdel-Hamid said a column of vehicles carrying armed Gaddafi loyalists drove up to the refinery's checkpoint on Monday morning.
"It was a very bold attack ... From what we understand there was an exchange of gunfire, doctors here at the hospital told us that some of the dead were shot point blank," he said.
Ras Lanuf is located approximately 600km east of the capital, Tripoli, and 80km away from the current frontline of the fighting, Hamid said.
China recognises NTC
On the diplomatic front, China formally recognised the NTCa s Libya's government, the state-run Xinhua news agency reported on Monday.
Beijing "officially recognised the ... NTC of Libya as the ruling authority and representative of the Libyan people", the English service of the official newswire reported.
China's Foreign Ministry said in a statement that China respected the choice of the Libyan people. It said Beijing hoped that all signed treaties and agreements will remain in force.
China is the last member of the UN Security Council to recognise the NTC.
"NTC officials and the Libyans say that the Chinese were betraying the revolution, arming [Gaddafi] in the past," Al Jazeera's Ahelbarra said from Tripoli.
"[They say] it will take more than the Chinese to make just an official statement ... This will be the nation that has make do a lot of efforts in the future to earn the trust of the Libyans.
China had previously criticised the NATO-led air campaign against Gaddafi's forces and refused to condemn the dictator.
Niger's prime minister said dozens of members of Gaddafi's inner circle had arrived in Niger since September 2.
"A total of 32 people are now here, including one of [Gaddafi's] sons, Saadi, as well as three generals," said Brigi Rafini, during a meeting with foreign diplomats in Niamey, the AFP news agency reported.
The arrivals had crossed the border in four separate groups over the last 10 days and had been taken in by Niger for "humanitarian reasons", the prime minister added.
NTC fighters, meanwhile, said they had advanced towards Sirte despite tougher-than-expected resistance from Gaddafi loyalists.
Sirte, Bani Walid and Sabha are the only towns remaining under the control of Gaddafi supporters.
The NTC has said that it will not declare Libya "liberated" until it has taken control of all areas still in the hands of Gaddafi loyalists.