Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

KABUL, Afghanistan — The Taliban's longtime leader Mullah Omar is dead, the Afghan government announced Wednesday after a day of feverish speculation.

"I can confirm that Mullah Omar is dead," the spokesman for Afghanistan's National Directorate of Security Abdul Hassib Sediqi told NBC News. "According to our intelligence Mullah Omar has died in a hospital in Pakistan a couple years ago."

Rumors had swirled for years that the one-eyed leader of the militant group that ruled Afghanistan until being toppled by U.S.-backed forces 2001 had passed away. The State Department had offered a $10-million reward for information leading to him, saying Omar "represents a continuing threat to America and her allies."

Afghan intelligence officials told NBC News on Wednesday that the government came to the conclusion Omar had died about two years ago during a high-level national security meeting.

"[But] It was decided to not make an announcement due to the sensitivity of the time, and the government did not see it appropriate and helpful for the peace process to make the announcement," one senior security official told NBC News on condition of anonymity because they weren't authorized to speak publicly.

Related: Are Afghans Ready for Taliban's Return?

A second intelligence source said the issue had been raised at a meeting with security ministers and members of the country's high peace council, which is negotiating with the militants. The government had sufficient information to conclude that Omar died of hepatitis B about two years ago, and his death was kept secret to keep the group together, the source added on condition of anonymity.

This undated file photo reportedly shows Taliban supreme leader Mullah Mohammed Omar. ASSOCIATED PRESS, file

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Separately, a Taliban commander who also spoke on condition of anonymity confirmed Mullah Omar had died.

"I can assure you he is no more but the biggest problem is who is going to replace him," he said.

The Taliban denied their leader had died, and cautioning fighters and supporters against believing what the government in Kabul said.

"Be careful not to be fooled by the enemy's propaganda," Zabihullah Mujahid, a Taliban spokesman, said in a statement entitled "Attention!!!"

"So it is imperative upon Muslim ... people not to be fooled by this unfounded propaganda," he added. "So stay strong and continue your conquest and stay focused on your struggle."

Related: Everything You Need to Know About Taliban Peace Talks

One senior U.S. counterterrorism official highlighted that it wasn't the first time there were reports of Omar's death.

"We've thought so about nine times,” he told NBC News when asked whether U.S. officials thought the militant leader was dead.

According to Taliban sources, several factions are vying for power within the Taliban. One of them is headed by Omar's eldest son, Yaqoob and younger brother Mullah Abdul Manan. The second group is led by his deputy Mullah Akhtar Mohammad Mansoor, and the third is run by younger brother of slain commander Mullah Dadullah Akhund, Mullah Mansoor Dadullah.

Known as “leader of the pious,” Omar was the leader of the Islamic Emirate of Afghanistan, he was wanted by the United States for sheltering al Qaeda's Osama bin Laden in the run up to the 9/11 attacks. While members of Afghanistan's intelligence services have said for years that he was dead, militants maintained he was still in charge and running operations from the lawless Afghanistan-Pakistan border.

While he was out of sight — Mullah Omar reportedly objected to being filmed and photographed on religious grounds — he did issue periodic statements and guidance to his followers.

The latest statement attributed to him strongly hinted that the movement’s leadership endorsed peace talks with the government.

"It is our legitimate right to utilize all legal pathways" to achieve a peace, according to the letter released on July 14. It charged the movement's political office in Qatar with "conducting all political activities."

In June 2014, he or someone speaking for him called the swap of five Guantanamo Bay detainees for American soldier Bowe Bergdahl, who had been in captured in Afghanistan, a victory.

Mullah Omar or his proxies or others speaking in his name, have long called for the reestablishment of the “caliphate” in Afghanistan militants to boycott elections. He came to power in the 1990s in the midst of conflict and war. The Taliban, which he led, held out the promise of a pure, peaceful and corruption-free society — an appealing prospect for Afghans who had been brutalized for a decade by Soviet invaders and then a civil war.

His followers imposed an extreme interpretation of Sunni Islam — strictly segregating men and women, closing girls’ schools, and stripping many Afghans, in particular ethnic and religious minorities, of their rights. He and other members of the movement also welcomed bin Laden, who plotted the Sept. 11 attacks on the United States from Afghan soil.

Mushtaq Yusufzai reported from Peshawar, Pakistan. F. Brinley Bruton reported from London. Richard Engel reported from Istanbul, Turkey.