TRIPOLI, Libya - Two children and their parents were killed by machine-gun fire Saturday while trying to flee Moammar Gadhafi's hometown along with hundreds of other residents, as forces loyal to the ousted regime engaged in heavy clashes with revolutionary fighters surrounding the city.

Their bodies were brought to a makeshift hospital outside Sirte, said a doctor there, Nuri Naari. They were hit by machine-gun fire as they drove toward the positions of revolutionary forces on the edges of the city, he said. It was unclear who killed them.

Sirte is one of the last cities to remain in loyalist hands. After months of stalemate in Libya's civil war, anti-Gadhafi forces swept into the capital in August and their leaders set up a transitional government. But the continued fighting in holdout cities and the failure to find and capture Gadhafi has kept Libya's new leaders from being able to declare victory.

Revolutionary forces had given families inside Sirte two days to leave the city starting Friday, said Mustafa Abdul-Jalil, head of the National Transitional Council that now runs the country. They tried to keep a safe corridor open for civilians fleeing the coastal city.

"This period will give a chance for families to leave the areas of fighting," he said at a press conference Saturday.

Hundreds of cars carrying Sirte residents formed long lines at revolutionary forces' checkpoints leading out of the city, calmly waiting to be checked by the fighters as explosions echoed in the distance.

After weeks of fighting Gadhafi's loyalists inside Sirte, the fighters now hold positions about three miles (five kilometres) from the city centre, said commander Mustafa al-Rubaie.

Last week, the Libyan Defence Ministry announced that Sirte's port, airport and military base were all under their control.

Al-Rubaie told The Associated Press that fighters from the east seized control of Sirte's first residential district and a hotel where Gadhafi's snipers were based.

"There is heavy fighting going on in the streets of Sirte right now," he said. "The enemy is besieged from the south, east and west but it's still in possession of highly sophisticated weapons and a large amount of ammunition."

Al-Rubaie said Gadhafi forces were also in control of strategic positions inside the city, including high-rise buildings where snipers are positioned, making the revolutionary forces' advance slow and hard.

"The plan is that the eastern and western forces will meet in the middle of Sirte," al-Rubaie said. "When we reach this point, we will celebrate the liberation of Sirte."

Fighters on the western approaches to the city fired rockets and tank fire at loyalists' positions, while NATO aircraft were heard circling overhead.

Gadhafi's spokesman Moussa Ibrahim, meanwhile, denied reports that he had been captured, telling the Syrian-based TV station Al-Rai that he was travelling with 23 fighters in Sirte. There was no way to verify the identity of the man speaking in the audio recording, but it sounded like his voice and the TV station has become the mouthpiece for Gadhafi's resistance.

Many of those fleeing Sirte said conditions in the city continue to deteriorate, with food in short supply and no water or electricity.

"We couldn't leave our homes because of the shelling; we had to leave the city," said Ahmed Hussein as his wife, mother-in-law and two children watched the fighters search their car.

Cars, buses and trucks loaded with families and heaped with household goods lined up at the first checkpoint about half a mile (kilometre) from the front lines. Volunteers gave the families food and water while fighters checked documents and cars.

A small contingent from the humanitarian group Doctors Without Borders attempted to enter Sirte on Saturday to deliver medical supplies but turned back because of heavy shelling and no guarantees that the Gadhafi loyalist would hold their fire.

In between the bouts of shooting, Libyan fighters prayed.