KABUL — President Hamid Karzai moved quickly on Sunday to confirm Parliament’s decision to dismiss two senior security ministers the day before, but he reassured the Western allies that he would avoid a vacuum in the two ministries charged with fighting the war and organizing the transition to Afghan control.

In a statement, Mr. Karzai said he had requested that both of the men who were dismissed, Defense Minister Abdul Rahim Wardak and Interior Minister Bismillah Khan Mohammadi, stay on until replacements could be found. Describing them as “true sons of Afghanistan,” he said that they would be decorated for their service and would remain in the government in different jobs.

The effects of the dismissals will not be clear until Mr. Karzai signals how quickly he expects to replace them and the level of presidential trust they will enjoy in the interim, government officials said.

While some in Parliament who voted for the removal of the two officials were upset that the president did not act immediately to replace them, others said a delay would be understandable. “We have fighting almost every day in all of the provinces; therefore, he should find the best candidate. These ministries are both extremely important,” said Hajji Obaidullah Barakzai, a lawmaker from Uruzgan Province.

The Parliament’s motivation for removing the two ministers remained unclear. Some observers said that the men had failed to award jobs and contracts widely enough and had slighted Parliament members’ demands.

Mr. Karzai was responsible the last time two ministers were removed, in June 2010, when his disapproval of the performance of the interior minister, Hanif Atmar, and the director of the intelligence service, Amrullah Saleh, compelled them to resign.

In those cases, Pakistan prodded the Afghan government to act because it considered the men to be hostile to Pakistani interests.

Pakistan may have been a factor this time, too, but the circumstances are more complex.

In interviews this weekend, Pakistan’s interior minister, Rehman Malik, accused Afghanistan of harboring insurgents hostile to Pakistan. The accusation rankles Afghans, who feel that they have been the victim of insurgents from havens in Pakistan, and, more recently, of repeated rocket attacks from within Pakistan.

Mr. Mohammadi has been strongly critical of Pakistan, but was seen as failing to protect Afghans from attacks across the border, Afghan officials said.

When he appeared before Parliament on Saturday, he again warned the lawmakers that whether he remained in his job or not, Afghanistan would remain vulnerable to Pakistan. “As long as ISI is free to intervene in Afghanistan, we will not see a happy day,” he said, referring to Pakistan’s spy agency, the Inter-Services Intelligence. “They still have a very antagonistic strategy toward us.”

Pakistan did not have to press Parliament to remove Mr. Mohammadi or Mr. Wardak because lawmakers were already unhappy with access to patronage networks and their growing sense of the country’s vulnerability.

“There have been attempts to bribe Parliament on national issues, but it has not worked. Their stands reflect their fears or hopes,” said Ashraf Ghani, a senior adviser to Mr. Karzai and leader of the security transition, adding that Mr. Mohammadi’s criticisms of Pakistan had done little to assuage their fears of further hostilities from Pakistan and “a perception of national humiliation.”

Several Parliament members said they were disappointed that Mr. Karzai had not handed over the ministries to the deputy ministers.

One Parliament member, Gul Pacha Majidi of Paktia Province, said he had hoped that the president would put the deputies in charge, and he said that he and others were wary about whether Mr. Karzai would make good on his promise to nominate new ministers.

Mr. Karzai has sometimes ignored the Parliament’s decisions to dismiss ministers, leaving them in charge for months or years. However, most lawmakers said Sunday that they did not think that would happen in this case.