KABUL - Afghanistan's Supreme Court announced Sunday that President Hamid Karzai should remain in office until a new leader is chosen in a late-summer election, a decision that effectively extends his term more than three months, state TV said.

Afghanistan's constitution says Karzai's term expires May 21, and a vote should be held 30 to 60 days before that. However, the country's election commission pushed back the election until Aug. 20 because of security fears, lingering mountain snows, and logistical problems such as ballot distribution.

But that decision left at least a three-month gap between the end of Karzai's term and the election. And because of vote-count delays and a possible election run-off, Sunday's court decision could mean Karzai will remain in power into October -- a five-month extension opposition legislators have said they will not accept.

Confusion surrounded the Supreme Court announcement, however, which was made on the nightly news on Afghanistan's state TV. The report said the court held a special meeting to decide the issue, but the spokesman for the Supreme Court and even a court justice, Bahuddin Baha, told The Associated Press they were not aware of any such meeting or decision.

A spokesman for Karzai's office, Waheed Omer, at first said he was also not aware of the decision. But Omer called back minutes later to say "we think it has happened," but that palace officials didn't yet know any details.

The state TV announcement said the court found "the continuation of the work of the president and vice-presidents until the time of the new president is to the benefit of the people and state."

Opposition leaders have said parliament won't accept Karzai as president after May 21, and warned an extension of Karzai's term could trigger countrywide demonstrations.

Because of that, Karzai ordered the election commission earlier this year to review its election date and possibly move up the vote if possible. But the commission -- as well as international officials and observers -- said moving up the vote would be impossible because of logistical and security concerns.

Karzai said he would ask the Supreme Court to review the constitution and make a ruling. Karzai on Friday said he expected that decision within days.

Mohammad Nahim Farahi, a legislator and member of the National Front, a group of opposition legislators, said the Supreme Court does not have the right to make an "ordinary" person the president of Afghanistan.

"Why am I saying ordinary person? It's very clear for everybody. After May 21, Karzai will be an ordinary person like everyone else in the country," Farahi said. "It's not up to the Supreme Court to put someone into the position of president."

Farahi said the only solution was for a loya jirga, or grand meeting of elders and leaders, to decide the issue.

Karzai told a news conference earlier this month it could be legal for him to stay in power in the interim, saying if the first part of the constitution's Article 61 is delayed -- namely the vote date -- then his term should also be extended.

The Supreme Court on Sunday followed Karzai's rational, saying the first part and second part of Article 61 "are linked."