Heads of state from around the world jetted into the Saudi capital amid tight security Tuesday for the funeral of King Fahd, Saudi Arabia's ruler for almost a quarter of a century, who died Monday after a long illness.

Thousands of police were deployed to the capital for the ceremonies. Large crowds were expected for prayers for the dead at a Riyadh mosque, from where mourners were proceeding to the cemetery.

Newly crowned King Abdullah was to lead the ceremony, with monarchs, presidents and other dignitaries participating alongside other mourners.

Saudis flocked to the capital to express their condolences and their allegiance to Abdullah, Fahd's half brother. Abdullah, 81, took the throne after the 84-year-old Fahd's death Monday in a smooth succession that suggested the sprawling royal family was unified in the need to show stability in the first change in the monarchy in 23 years.

State television showed well-wishers lined up at the palaces of provincial governors across the country to pledge their loyalty to Abdullah, who had been the kingdom's de facto ruler since Fahd suffered a debilitating stroke in 1995.

Saudi and pan-Arab newspapers, with black borders in mourning for the king, were packed with poetry and paid advertisements from people mourning Fahd and praising Abdullah.

Satellite TV stations seen across the Arab world, many of them owned by Saudi businessmen, had wall-to-wall Fahd coverage, showing preparations for the funeral and talk shows on Fahd's life. One Saudi-owned entertainment channel, Rotana, stopped its usual fare of sexy music videos and aired simply a picture of Fahd with Quranic readings.

The emphasis on stability was key as Saudi Arabia, a US ally, remains nervous about the future. Abdullah has taken small steps toward political reform - including elections earlier this year for local councils - but he faces popular pressure for greater change. He also has waged a crackdown on al-Qaida-linked groups after a wave of attacks in May 2003.

Arab leaders, including Egypt's Hosni Mubarak, Jordan's King Hussein, emirs from Gulf nations, Iraqi Prime Minister Ibrahim al-Jaafari and the presidents of Yemen, Tunisia and Lebanon, were flying in for the ceremonies.

Security forces erected checkpoints and locked down the motorcade route from the city center to the airport, where Saudi officials in flowing robes and traditional Arab headdresses waited in searing summer heat to greet leaders from Arab countries, Afghanistan and African states such as Senegal.

The ceremony is not officially a state funeral - an innovation Saudis say is not part of the kingdom's strict version of Islam known as Wahhabism. Fahd, like his predecessors, will be buried in an unmarked grave, in keeping with austere Wahhabi traditions that stress the equality in all in death and that frown on the visiting of gravesites common in other Muslim cultures.

Western leaders and dignitaries including Britain's Prince Charles, French President Jacques Chirac and Australia's governor-general were also arriving. A US delegation will also attend. But non-Muslim VIPs will not allowed to participate in the prayers or the burial.

After the burial, dignitaries and commoners will turn to the palace to pay their respects to Abdullah - a chance to honor the new leader of a nation that fuels investment around the Islamic world with its oil wealth and plays a major role in Mideast conflicts, such as violence in Iraq and the Israeli-Arab peace process.

On the internal front, there was plenty of time for the royal family to ensure an orderly handover. Fahd had been in the hospital for two months before his death. When his death was announced early Monday and Abdullah was named king, Fahd's brother Prince Sultan was made the new crown prince - next in line for succession - all according to plans laid long before.

For now, the transition smooths over a potential long-term rivalry between Abdullah and the circle of Fahd's full brothers known as the Sudairi Seven, after their mother. All are sons of Saudi Arabia's founder, Abdul-Aziz bin Saud, but he had numerous wives.

Under Fahd, the Sudairi Seven dominated some of the government's most powerful posts. While they will stay in their positions, the next generation of royals - Abdul-Aziz's grandsons - are looking for position, with an eye on the still unclear succession in the years ahead when Abdullah and Sultan's aging generation moves aside.

One key post that may be the focus of deal-making and contention in is the intelligence minister, a powerful position empty since January in which Abdullah may want to install a loyalist.