King Fahd bin Abdul Aziz of Saudi Arabia, who died Aug. 1 at the age of about 84, was a man of contradictions who ruled a country of contradictions.

By turns profligate and abstemious, corrupt and correct, energetic and lazy, dedicated and indifferent, he demonstrated both voracious appetites and undoubted abilities. He was admired as a forward-looking modernizer and loathed as a corrupt autocrat, sometimes by the same analysts.

His greatest accomplishment was to hold his country together and preserve his family's rule in an era of immense pressures, both domestic and external.

Slowed by illness in the past decade, he became largely a figurehead, appearing on television on ceremonial occasions but leaving most key decisions to his younger brothers. After suffering a stroke in late 1995, Fahd officially transferred his authority to his half brother and heir apparent, Crown Prince Abdullah. The transfer was ostensibly temporary and Fahd officially reclaimed his power several weeks later, but he exerted little direct control over the kingdom's day-to-day affairs.

His official title, by which he was always identified in the Saudi media, was "Custodian of the Two Holy Mosques" in Mecca and Medina. Fahd adopted that label in 1986, during a time when the kingdom was still recovering from its greatest domestic trauma, the 1979 seizure by religious fanatics of the Grand Mosque at Mecca, the holiest site in Islam, and Fahd was polishing his credentials as the protector and guarantor of the faith.

In international affairs, Fahd was a relative moderate on Israel, a proponent of stable oil prices and a usually reliable strategic and economic partner of the United States. Conservative Saudis and Muslims around the world reviled him for allowing U.S. and other foreign troops to establish themselves in the kingdom in preparation for the 1991 Persian Gulf War -- the action that made the House of Saud the principal target of Osama bin Laden -- but Fahd's admirers praised his courage in breaking out of Saudi Arabia's xenophobic tradition and making a crucial decision in defense of the kingdom's strategic interests.

As a young prince, Fahd originally made his mark as an advocate of increased educational opportunities for the Saudi people, but as ruler, he was no liberal in domestic affairs. His government often resorted to harsh justice to keep his subjects in line, with public beheadings the preferred instrument of authority, and Fahd was widely criticized by Saudis and foreign residents alike for greatly increasing the authority of the country's conservative religious establishment in the 1980s.

Within the Saudi royal family, however, Fahd was known as an affable compromiser who sought to restrain brothers and cousins who advocated even tougher measures to preserve the country's rigidly orthodox social and religious customs.

As king since 1982 and de facto ruler for several years before that under a weak predecessor, Fahd presided over the spectacular modernization of the country while campaigning to keep its social, political and religious environment as close as possible to what they were in the desert backwater of his youth.

Fahd's name and face were familiar to everyone in the Arab world, but he was never a figure of admiration to the Arab masses or a revered leader in the mold of Egypt's Gamal Abdel Nasser. That was not Fahd's aim or his destined role. In the unique environment of Saudi Arabia, Fahd did what he was born to do: preside over a family-run enterprise, keep potential rivals bottled up or bought off, paper over the cracks in Saudi society and defend the House of Saud against its innumerable enemies.

During Fahd's eventful lifetime, his country changed to an almost incomprehensible degree. When he was born in about 1921, before oil was discovered, the Arabian Peninsula was a remote, impoverished and sparsely populated land where schools were few, roads and hospitals fewer and the sword was the law.

As a young cabinet minister, as crown prince and as king, Fahd was by reputation a driving force in channeling untold billions of the country's oil revenue into construction of roads, hospitals, housing, airports, communications networks and schools, including schools for girls. The great challenge he faced as king was balancing the inevitable pressure for social change engendered by this material transformation with the kingdom's insular, conservative social and religious traditions.

Outsiders' knowledge of Saudi affairs in Fahd's youth is sketchy. By most accounts, Fahd was a favorite of his father, King Abdul Aziz ibn Saud, and groomed from his early days for a position of importance and eventual succession to the throne. He had little formal education, other than training in the Koran, but learned traditional Arabian skills such as falconry and camel racing from his father. Abdul Aziz reportedly kept young Fahd nearby during Council of Ministers meetings, ready for whatever tasks needed doing.

At age 24, at a time when few Saudis had traveled outside the Arabian Peninsula, Fahd went to San Francisco to participate in the 1945 international conference that wrote the United Nations charter. He developed a strong attachment to things American, an attachment that earned him his reputation as the most pro-American and pro-Western of the ruling princes.

In 1953, he was appointed education minister. He moved in 1962 to the key post of interior minister, the kingdom's chief guardian of security and public order. That was a time of tension, provoked by a conflict with Egypt's Nasser over the civil war in Yemen and exacerbated by internal debates over whether and when to oust Abdul Aziz's successor, the weak and erratic King Saud.

The princes did finally remove Saud in 1964, with Fahd playing an important role in a bloodless and orderly transition that placed his older brother, Faisal, on the throne.

Fahd was building up an impressive resume, but it took him some time to overcome the playboy reputation he had built up in the 1950s in the fleshpots of Beirut and Europe. According to one 1990 account in Time magazine, Fahd was "a sybarite who virtually abandoned his desert kingdom for a career of overseas carousing."

"He drank Scotch freely, ordered caviar by the pound, attended the raunchy shows in the nightclubs of Beirut so frequently that he knew all the leading belly dancers by name, engaged in myriad liaisons with women (he is said to have paid the wife of a Lebanese businessman $100,000 a year to make herself available) and, if the old stories are to be believed, gambled away $1 million in the casinos of Monte Carlo during a single weekend."

Most accounts of Fahd's life say he changed his ways, or at least moderated his displays of excess, after his older brother, then Crown Prince Faisal, summoned him home for a warning that his behavior was jeopardizing his claim to succession.

King Faisal was assassinated in 1975, to be succeeded by the amiable but ineffectual Khalid, who was troubled by a weak heart and paid little attention to governing. Fahd was designated crown prince. In that capacity, he presided over several years of spectacular growth and change as the kingdom cashed in on fast-rising oil prices.

In those days Saudi Arabia was awash in money. Its ports were so clogged with ships bearing goods that perishables had to be unloaded by helicopter. Almost overnight, freeways and air conditioning supplanted caravans and tents.

Many people in Saudi Arabia became immensely rich, including Fahd and members of his immediate family and a network of brokers and middlemen who were in favor with the ruling princes. While ordinary Saudis benefited from a state largess matched in few other societies -- free education and medical care, subsidized housing, tax-free wages -- many also became resentful of the obvious profligacy of the super-rich, whose lavish palaces sprang up around Riyadh and Jiddah.

As the bills came due in the 1980s and oil prices plummeted, Fahd faced a new challenge: maintaining the lifestyle to which Saudis had become accustomed. Fahd responded by emphasizing an effort to promote private-sector industries and diversify the country's economy away from oil, but his success was limited because the country has few natural resources other than petroleum.

The portly, fun-loving Fahd was renowned for his erratic work habits.

Weeks would pass in which he all but ignored affairs of state in favor of camping in the desert with his brothers. Then he would work almost nonstop for several days, preferably in the Red Sea port city of Jiddah, which he always preferred to the more austere Riyadh.

Fahd was married and had at least six sons and several daughters.

King Fahd, born in about 1921, saw his country change greatly. Before oil was found in the 1930s, the Arabian Peninsula was a remote, impoverished land.