George Tenet has resigned as director of the CIA, citing "personal reasons".
George Tenet is one of the longest-serving CIA chiefs
President George W Bush accepted the resignation and said he would miss the "strong and able" Mr Tenet as head of the US intelligence agency.
The CIA has been at the heart of criticism over faulty intelligence in the run-up to the Iraqi war and over whether 9/11 could have been prevented.
Mr Tenet, 51, will leave the CIA on 11 July when Deputy Director John McLaughlin will take over temporarily.
Meanwhile it has emerged that a second top CIA official is to resign on Friday.
Deputy Director for field operations James Pavitt, who has been at the CIA for more than 30 years - apparently made the decision some weeks ago, and is citing personal reasons.
While the move will mean more upheaval at a critical time for the agency, it had been expected.
Mr Bush told reporters Mr Tenet visited him at the White House on Wednesday night.
"I told him I'm sorry he's leaving. He's done a superb job on behalf of the American people," Mr Bush said.
Born 5 January 1953 in New York to Greek immigrants
Studied at Georgetown and Columbia universities
Served on Clinton's National Security Council 1992-95
Deputy CIA director 1995-96
Acting CIA director 1996-97
Confirmed as CIA director 1997
White House spokesman Scott McClellan later told reporters that Mr Bush did not ask Mr Tenet to resign and had no advance notice he would do so.
In a farewell speech to CIA employees, Mr Tenet said his resignation had "only one basis in fact: the well-being of my beautiful family".
Choking back tears, he told his son Michael, a teenager who was sitting in the audience: "You've been a great son - and now I'm going to be a great dad."
Correspondents say Mr Tenet, who has been in the post for seven years, had been widely expected to step down after the November presidential election. His sudden departure now has got Washington wondering, says the BBC's Adam Brookes.
Unusually, Mr Tenet has served under two presidents from different parties, having been appointed by President Bill Clinton.
String of crises
In May, a panel investigating the 11 September 2001 attacks on the US released statements criticising the CIA for failing to fully appreciate the threat posed by al-Qaeda before the attacks. Their full report is due out in July.
Mr Tenet told the panel that systemic problems in the intelligence community had left the country vulnerable and would take five years to fix.
Following Thursday's surprise announcement, the presumptive Democratic presidential nominee, John Kerry, said he wished Mr Tenet "the very best", but he said the Bush administration had to take responsibility for "significant intelligence failures".
Mr Kerry, who has previously called for Mr Tenet to step down, said this was an opportunity to reform the US intelligence services.
Tenet's staying power
After the 11 September attacks, many commentators thought Mr Tenet's position was at risk - but President Bush stuck by his intelligence chief.
Mr Tenet has also been in the spotlight over intelligence failures in the run up to last year's US-led invasion of Iraq, specifically over claims made by the US about Saddam Hussein's alleged arsenal of weapons of mass destruction.
In recent months senior figures in Washington have blamed the agency for overstating its case.
CIA agents are also being investigated over the abuse of Iraqi prisoners at Baghdad's Abu Ghraib prison.
Last July Mr Tenet accepted full responsibility for unsubstantiated allegations about Iraq's weapons programme being included in Mr Bush's State of the Union address.
Mr Bush had said in his January 2003 speech that Iraq was trying to buy uranium in Africa, but the White House later said the allegations were questionable.
Mr Tenet said the CIA had seen and approved the speech before it was delivered, and he took responsibility for the mistake.
Observers say Mr Tenet and the CIA gained respect from the Bush administration for their part in the overthrow of the Taleban regime in Afghanistan. The CIA sent in covert teams in late 2001 before the full-scale military action and is credited with hastening the downfall of the regime that supported al-Qaeda.
CIA agents have also been involved in the capture of what the US says is two-thirds of the al-Qaeda leadership, but that success is tempered by the failure to find the network's leader Osama Bin Laden.