TRIPOLI, Libya — Rebels battled Moammar Gadhafi’s troops Thursday for control of central Misrata, driving dozens of snipers from tall buildings in hours of urban warfare and gaining a tactical advantage in the only major city held by the opposition in western Libya, witnesses said.

The Libyan government, meanwhile, ramped up its rhetoric against NATO, warning that “it will be hell” for the alliance if it sends in ground troops, even though Britain’s prime minister said the Western nations were not moving toward such a deployment.

U.S. Defense Secretary Robert Gates said President Barack Obama has approved the use of armed Predator drones in Libya. The drones allow for low-level precision attacks and are uniquely suited for urban areas such as Misrata, where NATO airpower has been unable to protect civilians when Gadhafi’s forces are operating inside the city.

Also Thursday, rebels captured a Libyan border crossing into Tunisia, forcing government soldiers to flee over the frontier and possibly opening a new channel for opposition forces in Gadhafi’s bastion in the western part of the country.

At least seven people were killed in Thursday’s fighting for the main Misrata thoroughfare of Tripoli Street, bringing to 20 the number slain in three days in Libya’s third-largest city.

Misrata has been besieged by government forces for nearly two months, with human rights groups estimating hundreds of people killed. Tripoli Street is the site where two Western photojournalists were killed Wednesday as the rebels tried to dislodge the snipers loyal to Gadhafi perched on rooftops.

The street, which stretches from the heart of Misrata to a major highway southwest of the city of 300,000 people, has become a front line for the rebels and Gadhafi’s forces.

The rebels took over several buildings along parts of the street, enabling them to cut off supplies to a Gadhafi unit and dozens of rooftop snipers who have terrorized civilians and kept them trapped in their homes, said a doctor who identified himself only as Ayman for fear of retaliation.

“This battle cost us lots of blood and martyrs,” the doctor said.

Residents celebrated and chanted “God is great” after the snipers left a battle-scarred insurance building that is the highest point in central Misrata, according to a witness who identified himself only as Sohaib.

“Thanks to God, the snipers fled, leaving nothing behind at the insurance building after they were cut off from supplies — ammunition, food and water — for days,” added another resident, Abdel Salam.

He called it “a major victory” because the structure gave the pro-Gadhafi forces a commanding view of the city.

In Tripoli, government spokesman Moussa Ibrahim claimed Gadhafi forces control more than 80 percent of the city and the rebels hold “the seaport and the area surrounding it.”

Residents said that at the beginning of the battle for Misrata, the government deployed tanks and shelled the city indiscriminately, forcing residents to flee their homes and businesses, which were taken over by Gadhafi’s forces. NATO commanders have admitted their airpower was limited in being able to protect civilians in cities such as Misrata, which was the main mission of the international air campaign.

Abdel Salam, who asked to be identified only by his given name for fear of retribution, said Gadhafi’s forces were using tanks and rocket-propelled grenades.

“Col. Gadhafi’s troops continue their vicious attacks, including the siege of Misrata,” Secretary of State Hillary Rodham Clinton said in Washington. “There are even reports that Gadhafi forces may have used cluster bombs against their own people.”

Libyan officials have persistently denied the use of cluster bombs, which indiscriminately spray small bomblets over a wide area and are particularly lethal in residential areas. However, Human Rights Watch has said it found evidence of cluster bombs being used by government forces in Misrata.

Earlier this week, Britain, Italy and France said they were sending military officers to advise the rebels, prompting speculation that this was a step toward sending in ground forces at a time when NATO airstrikes were failing to break the battlefield stalemate or protect civilians in Misrata.

Ibrahim, the government spokesman, warned that NATO would find itself entangled in fighting ordinary Libyans if its soldiers were to set foot on Libyan soil.

“We are arming the whole population, not to fight the rebels, by the way, because the rebels are very easy — they are not a challenge for us,” Ibrahim said. “What we are fighting is NATO now.”

Ibrahim said the Gadhafi regime is ready to observe an immediate cease-fire and negotiate the terms of political transition. Rebels have said Gadhafi must step down before such talks can begin.

“We are ready and accepting peace … but we are also ready for war,” Ibrahim said. “If NATO comes, it will be hell.”

But British Prime Minister David Cameron insisted NATO isn’t edging toward deploying ground troops in Libya. Italy, France and Britain are sending experienced combat advisers to help train and organize Libya’s opposition forces to dislodge Gadhafi after four decades in power.

Ministers have insisted the officers won’t play any role in offensives against Gadhafi’s troops — and have said repeatedly that NATO and allies won’t overstep boundaries set out in the United Nations resolution authorizing action in Libya.

“We’re not allowed, rightly, to have an invading army, or an occupying army,” Cameron told BBC Scotland radio. “That’s not what we want, that’s not what the Libyans want, that’s not what the world wants.”

The capture of the border crossing with Tunisia in western Libya came after three days of intense fighting outside the desert town of Nalut, about 140 miles southwest of Tripoli, said a rebel leader, Shaban Abu Sitta. The area was briefly in hands of anti-government forces last month before Libyan troops moved in.

Holding the Dhuheiba border crossing could open important supply routes for anti-Gadhafi forces and give the rebels another foothold in western Libya.

After taking control of the crossing early Thursday, rebels raised the pre-Gadhafi tricolor flag.

In recent weeks, more than 10,000 Libyans from the border region had crossed into Tunisia, and 1,200 found shelter in a tent camp near the village of Dhuheiba, a few miles from the border. When people in the camp learned of the takeover of the crossing, they chanted, “The rebels brought freedom to their town.”

By afternoon, hundreds of Libyan refugees had assembled at the crossing, waiting to return home.

Also Thursday, the Greek passenger ferry Ionian Spirit carried more than 1,000 people fleeing Misrata to the rebel stronghold of Benghazi in eastern Libya, where 30 ambulances were waiting.

The ship’s passengers included dozens of wounded and shell-shocked Libyans, hundreds of migrant workers from Africa, as well as smaller groups from Pakistan, Nigeria and the Philippines. Four of the injured were seriously hurt

It also carried the bodies of two photojournalists killed in Misrata on Wednesday: Chris Hondros, a New York-based photographer for Getty Images, and British-born Tim Hetherington, co-director of the 2010 Afghanistan war documentary “Restrepo” that was nominated for an Academy Award. Also aboard was the body of a Ukrainian doctor who was killed by an artillery blast in Misrata.

Several banners were hung to greet the ferry. One said: “U.K. and U.S., your blood was mixed with ours in Misrata.”

Maggie Michael reported from Cairo. AP writers Ben Hubbard aboard the Ionian Spirit, David Stringer in London, Pier Paolo Cito in Dhuheiba, Tunisia and Lolita C. Baldor in Washington contributed to this report.