Kuwait's ailing emir has agreed to abdicate under a deal worked out within the ruling family, a lawmaker said Monday — paving the way for the prime minister and longtime de facto ruler to take the reins of power.

The accord followed an unprecedented public quarrel within the ruling family over who would lead the country, one of Washington's most steadfast allies in the Middle East and a major oil producer, after the death of its longtime leader.

One faction backed the ailing new emir, Sheik Saad Al Abdullah Al Sabah, and the other — including the Cabinet — supported the prime minister, half brother to the previous leader, who died Jan. 15.

The two camps met Monday night to try to reach a compromise before a parliament debate Tuesday over whether Sheik Saad should be ousted in favor of the prime minister, Sheik Sabah Al Ahmed Al Sabah.

In announcing the abdication deal, lawmaker Nasser al-Saneh told The Associated Press "an agreement has been reached in the family and (Sheik Saad) will sign the abdication papers tomorrow."

It was not known when Sheik Sabah would take the oath as emir.

As prime minister, Sheik Sabah has been running the day-to-day affairs of Kuwait since the longtime ruler, Sheik Jaber Al Ahmed Al Sabah, suffered a brain hemorrhage in 2001. Sheik Jaber ruled for 27 years and had been restored to power by U.S. forces after Saddam Hussein invaded the country in 1990.

As crown prince, Sheik Saad, Sheik Jaber's cousin, was treated for a bleeding colon in 1997.

Both Sheik Saad and the prime minister are in their mid-70s — their exact ages are not known — but Sheik Sabah is the more fit of the two. He had a heart pacemaker implanted but otherwise is said to be in good health.

The leadership crisis came to a head Friday when scores of ruling family members visited Sheik Sabah at his residence and asked him to take charge of the country.

The push for Sheik Sabah's ascension, however, was snarled when some members of Sheik Saad's branch of the ruling family objected. Key among them was Sheik Salem Al Ali Al Sabah, chief of the national guard and the oldest member of the family. His status as family elder added particular weight to his objection.

Some lawmakers had said they would boycott Tuesday's parliamentary debate, hoping the ruling family would find a compromise.

"Lawmakers don't want to take sides," Islamist legislator Walid Tabtabai, told reporters.

The 1964 succession law gives the Cabinet the right to ask parliament to transfer the emir's powers to the crown prince if it is proven the ruler is physically unable to carry out his duties. A two-thirds vote is needed.

Many Kuwaitis had voiced fears Sheik Saad would be unable to recite the full oath of office stipulated by the constitution. Since he succeeded his cousin just over a week ago, he has appeared in a wheelchair and has not spoken in public.

"I never wanted things to reach the point of removing his highness the emir," Hussein al-Qallaf, a Shiite cleric and lawmaker said. "It is difficult and it weighs heavily on all legislators. Sheik Saad is loved by all Kuwaitis."

The ailing emir is the son of Abullah Al Salem Al Sabah, who is known as the "father of democracy" and the founder of modern Kuwait.

Kuwaitis, who are used to a smooth succession, had hoped for a compromise by the ruling family. The nation's news media, meanwhile, had sided with Sheik Sabah.

"Things are as clear as the sun. The family has pledged allegiance to Sheik Sabah to run the country and he is qualified for that," wrote Al-Watan in its front-page editorial Monday.

"Go (ahead), your highness Sheik Sabah, and we will follow and support you," it said.