The White House has launched an investigation into who is responsible for mistakenly outing the top U.S. spy in Afghanistan over the weekend.

Chief of Staff Denis McDonough has asked the White House counsel Neil Eggleston to look into what happened and report back to him with recommendations on "how the administration can improve processes and make sure something like this does not happen again," according to White House National Security Council spokeswoman Caitlin Hayden.

The White House mistakenly outed the CIA's top official in Afghanistan after President Obama slipped into Afghanistan over the weekend on a surprise trip to visit U.S. troops in the region.

A White House press aide passed along to the media the name of the CIA's station chief in Kabul on a list of senior officials attending a military briefing for Obama during the trip. The aide reportedly received the list from the military.

In an interview on CNN Tuesday, Tony Blinkin, the president's deputy national security adviser, declined to say whether the station chief will be forced to leave his post in Kabul or what will happen to the agent.

“Rest assured that the security of this person is our first priority,” he said.

Exposing the identify of a senior CIA official is a grave mistake that will complicate the agent's career for years, if not indefinitely.

The disclosure appears to be the result of a simple blunder. Reporters who accompany the president on his travels routinely must serve "pool duty" - the process of chronicling the president's movements and details of his daily interactions and remarks to write up and pass along to thousands of journalists, including foreign media.

White House aides gave the journalist assigned to pool duty on Sunday the list that inadvertently included the station chief's name. It's common for the White House to provide such lists to reporters on pool duty but the names of intelligence officials usually are omitted.

After the pool reporter, the Washington Post's Scott Wilson, emailed his report that included the station chief's name to the White House press aides, the aides looked it over before sending it on to thousands of other journalists not on the trip. The White House soon recognized the mistake and issued a second list that omitted the station chief's name and title.