Sediq Seddiqi, the spokesman for the Interior Ministry, which is in charge of the police, flatly denied there had been any such closings, and he said the authorities had merely offered advice to restaurants and guesthouses on improving their security.

“We have not closed any restaurants or guesthouses,” Mr. Seddiqi said. “Any claim by the owners that we have made them close their restaurants is a baseless accusation.”

An intelligence agency official, who spoke on the condition of anonymity as a matter of official policy, confirmed that an unspecified number of guesthouses had been ordered closed. “It is done for their safety, and after our assessments of them, we decided to request a shutdown for some of these guesthouses which did not have good security and enough guards,” he said.

Since January, there has been a series of attacks targeting foreigners and places they frequent. In January, a suicide attack on the restaurant Taverna du Liban killed 21 people, 13 of them foreigners. In March, not far from the restaurant, a Swedish journalist was shot execution-style; nine people were killed by gunmen who sneaked into the luxury Serena Hotel; and, in what could have been a blood bath of about two dozen Americans and their children, an attack apparently aimed at a Christian-run day care center in Kabul narrowly missed.

“The Afghan government is not capable of providing security to expats,” said Peter Jouvenal, the Gandamack’s British founder and owner. “They had no concern as to where our guests would go — they insisted we throw them out on the streets. They were not interested in the safety of our foreign guests.”

Managers or workers at 11 central Kabul restaurants confirmed that the police had ordered them to close. L’Atmosphere, a restaurant and nightclub popular with foreigners and famous for its decibel level, had closed on its own in anticipation of such an order after the Serena Hotel was attacked.

“After the Serena attack, N.D.S. and Afghan police came to our restaurant and told us to close down until after the election,” said Parwiz Sharifi, manager of the Sufi Restaurant, which served Afghan food and was popular with both Afghans and foreigners. “They told us that we should stop serving people, especially foreigners, because of security threats to their lives.”