BAGHDAD
— It is a scene repeated daily throughout Iraq: hundreds of motorists queuing on the side of the road, waiting patiently for their turn to fill up their cars with gas.

Ihab Hussein, a student at Baghdad University, joined the queue for the Liberation gas station at 8 a.m. It took him four-and-a-half hours inching along a line of cars stretching almost two miles to reach the pumps.

For a country floating on the second-largest oil reserves in the world, it is a bitter irony for many Iraqis that the country is facing a fuel crisis that has created shortages of gasoline, diesel, kerosene, and propane.

Officials blame a lack of regular electricity to work the pumps, a huge increase in the number of vehicles, attacks by militants against oil pipelines, a thriving black market, dilapidated oil refineries, and increased demand in the Kurdish area of northern Iraq which was denied fuel during Saddam Hussein's regime.

"An awful lot of the problem stems from black marketeers and the perception in the country that there is a fuel shortage, which has resulted in panic-buying," says an official with the US-run Coalition Provisional Authority (CPA).

The coalition says 1 million gallons of fuel are to be imported from Turkey this week, which the official says will help address the problem.

But the daily fuel-consumption rate in Baghdad alone is estimated at 1.6 million gallons a day. The entire country runs through 4 million gallons a day.

The Ministry of Oil is hoping to purchase 10,000 tons of fuel from Iran and is negotiating similar deals with other countries including Qatar, Saudi Arabia, Kuwait, and Jordan.

"We have a 40-percent shortage in oil production," says Assem Jihad, a spokesman for the Ministry of Oil. "But the main problem is that the gas stations are selling their fuel on the black market so there is not enough for legitimate sales at the pumps."

Black marketeers, clutching rubber siphon pipes and jerrycans of yellow gas, are a common sight on the sides of roads.

Abu Mohammed normally drives a taxi, but he says it is more profitable to sell the gas in his tank on the black market than drive customers around Baghdad.

"It's my first day doing this," he says. "I queued from midnight to 6 a.m. to fill up my car with gas. My tank holds 24 gallons and I have already sold 5 gallons."

Abu Mohammed sells his gas at the black market rate of 750 Iraqi dinars (37.5 cents) a liter, 10 times the legal price.

For many Iraqis, the black market price is prohibitively high and they are forced to join the lengthy lines at gas stations.

"It's very embarrassing and shameful," says Mohammed al-Zubaydy, the director of the state-owned Liberation gas station as he eyes the queue stretching up the road. "We have enough benzene, but the problem is the crowd."

Customers endure the wait at his station because he has 10 pumps and a generator to keep them running when the electricity is cut.

Other gas stations, especially those that are privately-owned, are forced to close when they run out of gas or the power fails.

"People were buying fuel here and then emptying their tanks and selling it on the side of the road," says Mr. Zubaydy. "There's nothing we can do about it."

Unscrupulous street salesmen have been known to dilute the black-market gas with water. Even police sent to guard gas stations have been selling fuel at inflated prices and pocketing the difference.

With money to be made on the black market, security at gas stations is becoming a priority for many owners.

The Oil Ministry has set up a special unit of "Oil Police" to stand guard at gas stations to prevent looting. But the policemen are unarmed and say they are vulnerable. "People have been attacking the gas stations and the owners," says Sgt. Adnan Abbas. "But we have no guns. If someone came here to cause trouble, what can we do? Hit them with a brick?"

Zubaydy raises his jacket to reveal an automatic pistol tucked into his waistband.

"I want all my employees armed," he says. "Then we would feel more comfortable."

Some 250,000 to 400,000 new cars have flooded into Iraq since the war, imported from Kuwait, Jordan, and Syria, increasing the demand for fuel. The intermittent electricity supply has also created a surge in the use of generators, which also require fuel.

Iraq's oil refineries are in poor condition following years of neglect, running as much as 55 percent below capacity.

"They were built in the 1950s and were neglected under Saddam and sanctions," says Mr. Jihad of the Ministry of Oil, adding that three new refineries will be built.

Meanwhile, Iraqi crude oil is pumped to neighboring Turkey where it is refined and exported back as gasoline.

But the main pipeline to Turkey runs through miles of empty desert and is regularly blown up by militants. That has also delayed export of Iraqi oil via the terminal at Ceyhan on Turkey's Mediterranean coastline.

Iraq is exporting more than 1.5 million barrels per day, according to the CPA. Iraq's oil-production rate was about 700,000 barrels a day at the end of the war.

Oil ministry officials say the figure should reach 2.2 million per day by the end of the year and the prewar rate of 2.8 million during the first quarter of 2004.

The Iraqi police, backed by American troops, are conducting a crackdown on the black marketeers, arresting dozens.

Abu Mazen squats on the dusty sidewalk, his hands cuffed behind his back, while an American soldier confiscates his half-full jerrycan of black- market gas.

"Tell him that we will let him go this time but if we catch him again he will be arrested," an American sergeant tells his interpreter.