CAIRO - After hours of pushing through sweltering crowds at office windows, I was on the verge of registering my newborn son when the woman behind the counter uttered the phrase most dreaded from an Egyptian civil servant.

"Ma-yinFASH!" she said: It won't work!

The plump bureaucrat with dyed blond hair and bright red lipstick had noticed that the nationality on my three-month-old son Ray's birth certificate didn't match his passport - a quirk due to his dual citizenship from an American father and British mother. "It simply will not work," she said.

My quest was in danger of foundering inside the Mogamma - or "The Complex," a grey, 13-storey Orwellian monument to dysfunctional government service that squats in Cairo's main square.

It was an odd quest to begin with: I was seeking an entry stamp for Ray. His "port of entry" into Egypt was the delivery room at a Cairo hospital - and, not surprisingly, there was no customs official present. But for my wife and I to take him abroad for the first time, there had to be a record in his passport of his arrival.

That meant a journey through a notorious bureaucracy that millions of Egyptians navigate every day. According to one study, it takes each person an average of nine hours and 3.5 visits to a government office to complete a transaction like getting a building permit or school transfer.

Egyptians deal with it through resigned endurance, bribes and appeals for help from "wasta," Arabic for "connections" - well-placed officials, usually in the police or military. Global Integrity, an non-profit group tracking governance and corruption, gives Egypt's anti-corruption mechanisms its lowest rating - along with countries like Iraq, Ethiopia and Liberia.

The system feeds the widespread feeling among Egypt's nearly 80 million people that the state does little for them. The government has made some progress in paring down the red tape, but in some cases its reforms - like trying to computerize the system - have only added another layer.

"We have to admit two things, there is a complete breakdown in the services offered to the public, and that government employees are engaged in a kind of silent general strike from work," prominent columnist Fahmi Howeidi wrote recently.

The dark heart of the bureaucracy is the Mogamma. Built in 1950, it was originally conceived as an efficient one-stop shop for all Egyptians' official needs. Instead it's become a synonym for bureaucratic bloat, its musty corridors and offices crammed with 18,000 employees from a dozen ministries and scores of government departments.

In 2005 the prime minister ordered the building closed. But ordering and implementing are two different things in Egypt and, four years later, the Mogamma remains as crowded as ever.

After the weeks-long process of getting my son's passport from the British embassy - just days before a planned vacation abroad - I sallied forth to the Mogamma, infant strapped to my chest in his BabyBjorn, to complete what I assumed was the simple procedure of getting a stamp.

I was directed to Window 13 to collect the required form and immediately hit a wall. I didn't have any pictures of Ray to staple on the application and I hadn't photocopied his birth certificate.

I was sent to Window 29 and, after fighting past the sweaty mob of confused foreigners in line, I tried to bluff my way through without the necessary photographs. "Ma-yinFASH!" said the lady behind the glass, pausing briefly to coo at an increasingly distressed Ray. "You have the old birth certificate."

"Old? He's only three months, how could his birth certificate be out of date?" I asked, as Ray began to whimper. The heat and the crowds were getting to him. I noticed that many of the civil servants were wearing surgical masks, apparently out of fear of swine flu.

What I had was the old handwritten birth certificate. What I needed was the new computer-printed birth certificate - part of the government's program to get rid of the massive stacks of ancient binders stuffed with documents that clog every office.

So far the transition has only doubled the paperwork, since Egyptians now must acquire both the new and the old versions of documents.

For the new certificate, I headed to the civil registry office - in a hot downtown police station - which was crammed with people in long lines waiting before another hopeless row of windows.

It was 2 p.m. and closing time approached. In this situation, most Egyptians do what they must to make the system work: slip an employee a tip, a service fee, for instance, 50 pounds or about $9.

I won't say how it happened, but 15 minutes later I was out of there, computerized birth certificate in hand, while the line had barely moved.

The computerization program at least shows the government is trying to make a dent. Khaled Sewelam, research chief at the American Chamber of Commerce in Egypt, said many tasks once performed in the Mogamma - like paying traffic tickets and, it turns out, ordering copies of birth certificates - can now be done online.

"I think things are going in the direction that everything electronic is much better and I think that's the only way to fight corruption," he said.

Progress has been made in cutting red tape for businesses, said Sewelam. The time it takes to establish a company has dropped from 100 days to three in large part because of a "one-stop-shopping" investment authority that handles investors' paperwork.

Such reforms by Egypt's pro-business government helped double the country's growth rate and made it No. 1 on the World Bank's list of most improved developing economies in its 2008 "Doing Business" report.

Choking bureaucracy, however, remains the reality for the average Egyptian. Only 15 per cent of the population have access to the Internet and, in fact, only 50 per cent are literate. In a 2009 government survey, fewer than a third of respondents had used the online services.

The next day I re-entered the Mogamma, armed with photos, documents and copies. I progressed through Window 8, Window 13, bought special stamps at Window 41 and proudly deposited my stack of documents at Window 29.

That's when the question of my son's dual nationality hit. His passport was British but the birth certificate says he is American.

We were at an impasse. It was time to invoke a higher power.

"You'll have to go see the colonel," said the woman behind the counter. I was ushered through a maze of glass partitions to the office of police Col. Mustafa Bey, master of the Mogamma's second floor.

The intervention of the higher power is often the only way out of the Egyptian bureaucratic morass.

In one recent case, villagers just north of Cairo complained for weeks to the local government after dozens contracted typhoid because a corrupt contractor routed sewage through the water pipes.

They were ignored until they appealed directly to President Hosni Mubarak. On Aug. 1, state-owned newspapers trumpeted on their front pages that Mubarak had personally ordered local officials to fix the water network.

The colonel listened calmly as I explained my son's dual nationality. Finally, he allowed the process to proceed.

It took a while longer, I visited a few more windows, bought more stamps, talked with the colonel twice more and waited for several more hours.

But by day's end, my son had officially entered the country of his birth and could now leave it.