President Barack Obama will formally nominate James Comey, a top Justice Department official during the Bush administration, to head the FBI, a White House official said on Thursday.

The announcement is expected at a White House ceremony on Friday.

If confirmed by the Senate, Comey would replace Robert Mueller, who is leaving in September after leading the bureau for 12 years.

Comey is a former prosecutor who worked in New York and Virginia, where his caseload included terrorism, organized crime and fraud.

Comey served as a deputy attorney general during the Bush administration, a role for which he has received both praise and criticism from outside groups.

Comey testified to a Senate committee in 2007 that he considered resigning his high-profile position over a disagreement three years earlier about the National Security Agency's domestic surveillance program.

Government officials had told CNN that Comey had "vigorously opposed" aspects of the warrantless wiretapping program and refused to sign off on its continued use. The program was eventually reauthorized.

The White House official pointed to the incident as an illustration of Comey's character. The official said in a statement that he was "one of our nation's most skilled and respected national security and law enforcement professionals" who has demonstrated "toughness, integrity and principle."

The appointment comes as the Obama administration wrestles with new controversy surrounding NSA surveillance involving phone records and e-mail.

Human rights groups have criticized Comey's alleged support of other controversial Bush-era national security policies such as indefinite detention and detainee treatment programs like waterboarding.

CNN first confirmed in May the president's plans to nominate Comey, but at the time White House officials refused to confirm that the president had made a selection in his search for a new leader of the FBI.

Since leaving government, Comey has worked in executive positions at defense contractor Lockheed Martin and the financial management firm Bridgewater and Associates.

Currently he works in academia as a senior research scholar and Hertog Fellow in National Security Law at Columbia Law School.

Mueller officially started the FBI job days before the 9/11 terror attacks and later saw the agency through terrorism and other high-profile cases.

Mueller's term had been set to expire in September 2011 -- per the 10 years that FBI directors typically serve -- but, at Obama's request, Congress approved a two-year extension. He's now scheduled to step down in September.