The US Senate has finally confirmed John Brennan as CIA director after the White House doused a fierce debate over the potential use of domestic drones that could have delayed filling the crucial post.
Brennan, a counter-terrorism expert and 25-year veteran of the CIA, was the architect of the controversial secret programme that uses armed drones in "targeted killings" overseas.
He was given the green light on Thursday after a two-month confirmation process that heated up in its final week.
The Senate voted 63-34 with several Republicans approving Brennan following a dramatic 13-hour filibuster the night before by Senator Rand Paul, who demanded clarification from the White House on the limits of the government's legal power to kill its own citizens on US soil.
Obama welcomed the vote, praising Brennan's "determination to keep America safe, his commitment to working with Congress, his ability to build relationships with foreign partners and his fidelity to the values that define us as a nation".
The Brennan confirmation fills a crucial position on Obama's national security team, after senators gave their nod to John Kerry to lead the State Department and to Chuck Hagel as Pentagon chief.
Despite his reservations, Paul was among several Republicans who allowed the Brennan vote to go ahead, although he ultimately voted against Brennan's confirmation.
The senator from Kentucky had delayed the nomination, seeking clarification from the White House over whether it was US policy to allow the killing by a drone strike of a "non-combatant American citizen on US soil".
He got his answer on Thursday, when Attorney General Eric Holder wrote to tell Paul that this was not US policy.
Paul, who emerged from his filibuster as something of a political celebrity with backing from some fellow Republicans, said that receiving Holder's letter proved that "the entire battle was worthwhile".
Earlier this week Holder had commented that, while Obama had "no intention" of ordering drone strikes on US soil, the scenario could be possible if there was an "extraordinary circumstance" such as an attack similar to 9/11.