The assault on the Brega oil port battle - in which shells splashed in the Mediterranean and a warplane bombed a beach where rebel fighters were charging over the dunes - was the first major regime counteroffensive against the opposition-held eastern half of Libya. The population there, backed by mutinous army units, rose up and drove out Gadhafi's rule in the past two weeks.
In the capital of Tripoli, Gadhafi vowed, "We will fight until the last man and woman." He lashed out against Europe and the United States for their pressure on him to step down, warning that thousands of Libyans will die if U.S. and NATO forces intervene in the conflict.
The United States is moving naval and air forces closer to Libyan shores and is calling for Gadhafi to give up power immediately. The U.S., Britain and other NATO countries are drawing up contingency plans to impose a no-fly zone over Libya to prevent Gadhafi's air forces from striking rebels. But the idea has been rejected by Russia, which holds a veto-wielding seat on the U.N. Security Council.
"We will not accept an intervention like that of the Italians that lasted decades," Gadhafi said, referring to Italy's colonial rule early in the 20th Century. "We will not accept a similar American intervention. This will lead to a bloody war and thousands of Libyans will die if America and NATO enter Libya."
In Benghazi, Libya's second-largest city and the stronghold of the rebellion in the east, Gadhafi opponents announced the formation of an "interim national government council" in anticipation of the Libyan leader's fall. They named Gadhafi's former justice minister, Mustafa Abdel-Jalil, who joined the uprising, as the council's head.
The council called for foreign governments to carry out airstrikes against non-Libyan African mercenaries that the opposition says Gadhafi has used in his militias to put down the uprising. Council spokesman Abdel-Hafiz Hoga said the council urged airstrikes on the "strongholds of the mercenaries .... used against civilians and people."
For the past week, pro-Gadhafi forces have been focusing on the west, securing his stronghold in the capital Tripoli and trying to take back nearby rebel-held cities with only mixed success.
But the foray east against opposition-held Brega appeared to stumble. The pro-Gadhafi forces initially recaptured the oil facilities Wednesday morning. But then a wave of opposition citizen militias drove them out again, cornering them in a nearby university campus where they battled for several hours until the approximately 200 Gadhafi loyalists fled, according to an Associated Press reporter at the scene.
Opposition members said they believe Gadhafi was pulling up reinforcements from bases deep in the deserts of southwestern Libya, flying them to the fronts on the coast.
Soon after sunrise Wednesday, a large force of Gadhafi loyalists in around 50 SUVS, some mounted with machine guns, descended on opposition-held Brega, 460 miles (740 kilometers) east of Tripoli along the Mediterranean. The force caught a small opposition contingent guarding the site by surprise and it fled, said Ahmed Dawas, an anti-Gadhafi fighter at a checkpoint outside the port.
The pro-Gadhafi forces seized the port, airstrip and the oil facilities where about 4,000 personnel work, as regime warplanes hit an ammunition depot on the outskirts of the nearby rebel-held city of Ajdabiya, witnesses said.
Midmorning, the opposition counterattacked. Anti-Gadhafi fighters with automatic weapons sped out of Ajdabiya in pickup trucks, heading for Brega, 40 miles away (70 kilometers) away.
Dawas said they retook the oil facilities and airstrip. Other witnesses reported regime forces were surrounded by rebels. The sound of screaming warplanes and the crackle of heavy gunfire could be heard as the witnesses spoke to The Associated Press by phone.
By the afternoon, the regime fighters fled the oil facilities and holed up in a nearby university campus, where they came under siege by anti-Gadhafi fighters, according to an Associated Press reporter at the scene.
Machine gun and automatic weapons fire rattled in the air, and shells lobbed from the campus went over the anti-Gadhafi side to splash in the Mediterranean.
At one point, a warplane from Gadhafi's air force swooped overhead and an explosion was heard. A witness said it struck an empty stretch of dunes near the battle, sending a plume of sand into the air but causing no injuries in an apparent attempt to intimidate the anti-Gadhafi side.
But opposition citizen militias poured into the battle, arriving from Ajdabiya and armed with assault rifles. They moved through the dunes along the beach against the campus next to a pristine blue-water Mediterranean beach. Those without guns picked up bottles and put wicks in them to make firebombs.
An ambulance driver who was briefly held by the pro-Gadhafi force and then released told AP they numbered about 200 fighters. The forces came to Brega from Sirte, Gadhafi's main remaining stronghold in central Libya, 200 miles (320 kilometers) west of the oil port, said the driver, Jumaa Shway.
At least six opposition fighters were killed and 18 others wounded in the fighting, their bodies covered with sand thrown up by shells bursting in the dunes, doctors at Brega hospital said.
Angry crowds gathered around them at Brega's hospital, chanting, "The blood of martyrs will not go in vain."
In the late afternoon, the pro-Gadhafi force fled the campus, and opposition fighters were seen combing through the university buildings. Automatic gunfire was still heard in the distance, but it appeared the regime troops were withdrawing. The campus grounds and dunes between it and the beach were littered with casings and shells.
In Ajdabiya, people geared up to defend the city, fearing the pro-Gadhafi forces would move on them next. At the gates of the city, hundreds of residents took up positions on the road from Brega, armed with Kalashnikovs and hunting rifles, along with a few rocket-propelled grenade launchers. They set up two large rocket launchers and an anti-aircraft gun in the road. But by the evening, there was no sign of attack there.
Brega and nearby Ajdabiya are the farthest west points in the large contiguous swath of eastern Libya extending all the way to the Egyptian border that fell into opposition hands in the uprising that began Feb. 15. Ajdabiya is about 90 miles (150 kilometers) from Benghazi, Libya's second largest city and the nerve center of the opposition.
Brega is the second-largest hydrocarbon complex in OPEC-member Libya. Amid the turmoil, exports from its ports have all but stopped with no ships coming to load up with crude and natural gas. Crude production in the southeastern oil fields that feed into the facility has been scaled back because storage facilities at Brega were filling up. General Manager Fathi Eissa said last week the facility has had to scale back production dramatically from 90,000 barrels of crude a day to just 11,000.
The unrest in Libya - which ranks about 17th among world oil producers and has Africa's largest proven oil reserves - has sparked a major spike in world oil prices. Overall crude production has dropped from 1.6 million barrels per day to 850,000.
Gadhafi's regime has been left in control of Libya's northwest corner, centered on Tripoli, but even here several cities have fallen into rebel hands after residents rose up in protests, backed by mutinous army units and drove out Gadhafi loyalists.
In recent days, loyalists succeeded in regaining two of those towns - Gharyan, a strategic town in the Nafusa mountains south of Tripoli, and Sabratha, a small town west of the capital.
But opposition fighters successfully repulsed attacks by pro-Gadhafi forces on several others: the key city of Zawiya outside the capital; Misrata, Libya's third largest city east of Tripoli; and Zintan, a town further southwest in the Nafusa mountains.
The regime may be bringing in more forces from regions it still dominates in the sparsely populated deserts in the southwest.
Residents of the southwestern oasis town of Sebha - a key Gadhafi stronghold with military bases 400 miles (560 kilometers) south of Tripoli - reported heavy movement at the airport there Tuesday night, said Abdel-Bari Zwei, one of the opposition activists in Ajdabiya in touch with sympathizers in Sebha. Zwei said it is believed some of those forces were involved in the offensive against Brega.
In his speech Wednesday, Gadhafi lashed out at international moves against his regime, including the freezing of his and other Libyan assets abroad - an act he called "piracy" - and efforts by Europe to send aid to opposition-held Benghazi. He said any Libyan who accepts international aid was guilty of "high treason" because it "opens Libya to colonialism."
In a pointed message to Europe, he warned, "There will be no stability in the Mediterranean if there is no stability in Libya."
"Africans will march to Europe without anyone to stop them. The Mediterranean will become a center for piracy like Somalia," he said. Gadhafi's regime has worked closely with Italy and other European countries to stop African migrants who use Libya as a launching point to slip into Europe.
He also threatened to bring in Chinese and Indian companies to replace Western companies in Libya's oil sector if the West keeps up its pressure on him. European firms are heavily involved in Libya's oil production.