KABUL, Afghanistan — Afghanistan’s president is issuing an ultimatum to thousands of private security contractors he says are undermining his nation’s army and police force: Cease operations in four months.

President Hamid Karzai’s strident decision, announced Monday by his spokesman, is expected to meet resistance from NATO officials who rely heavily on private security companies to guard convoys and installations across the country.

With complaints that they are poorly regulated, reckless and effectively operate outside local law, such operators have become a point of contention between the Afghan government and U.S. and NATO coalition forces and the international community.

“The security companies have to go,” presidential spokesman Waheed Omar said Monday as he announced the deadline.

In Washington, Pentagon spokesman Bryan Whitman questioned whether a four-month deadline was realistic.

“I think everyone looks forward to the day when private security companies can be eliminated altogether from Afghanistan because the security situation is such that they are no longer needed,” Whitman said.

“Until that time, though, we’re going to continue to work with the government of Afghanistan to improve the oversight and management as well as developing plans to progressively reduce their numbers as security conditions permit.”

Maj. Joel Harper, a U.S. military spokesman in Kabul, said the military supports Karzai’s goal of eliminating private security companies, but that doing so requires “a deliberate process that recognizes the scale and scope of the issue.”

Karzai pledged in his inauguration speech in November to shutter both foreign and domestic security contractors by November 2011.

Now, according to Omar, Karzai is expected to take action more quickly and issue a decree to outline how the companies should cease operations.

“Within four months, all private security companies will be disbanded,” Omar said without providing details of Karzai’s expedited decree.

In Washington, State Department spokesman P.J. Crowley said Monday that U.S. officials want clarification and more details.

“At this moment, we believe there is still a need for private security companies to continue to operate in Afghanistan,” Crowley said, adding that the U.S. agrees security should eventually be an entirely Afghan operation. “Four months is a very challenging deadline.”

The U.S. military set up a task force in June to tighten regulation and oversight of its security contractors.

“Since the Afghan army and the Afghan police are not quite at the stages of capability and capacity to provide all the security that is needed, private security companies are filling a gap,” Brig. Gen. Margaret Boor said Monday before the new deadline was announced.

Boor said private security contractors can be phased out only as the security situation improves — a hard target given worsening security in recent months in areas of northern and central Afghanistan that had previously been relatively safe.

Though the U.S. task force is new, Boor said it is already taking steps to improve oversight of security firms, including registering all contractors and ensuring they have the necessary qualifications and receive training on appropriate use of force.