The US Senate foreign relations committee has approved Condoleezza Rice as President George W Bush's choice for secretary of state.
Rice was questioned aggressively at times
The confirmation comes after two days of tough questioning by the panel, which saw Ms Rice defend the first Bush administration's record over Iraq.
Ms Rice is to expected to be confirmed by the Senate on Thursday, becoming the first black female secretary of state.
President Bush is due to be inaugurated for his second term on Thursday.
Ms Rice was confirmed by a 16-2 vote, with Democratic Senators John Kerry and Barbara Boxer voting no.
The votes against her do not put her confirmation in doubt, but they do suggest she failed to reach out convincingly to those senators who say they would have liked to have supported a new start, says the BBC's Justin Webb in Washington.
Ms Rice is replacing Colin Powell, who on Wednesday bid an emotional goodbye to staff at the state department.
In her second and final day of questioning, Ms Rice acknowledged the government had made mistakes in Iraq.
Pressed on progress in providing training for Iraq's National Guard, Ms Rice said: "We have made a lot of decisions in this period of time. Some of them have been good, some of them have not been good, some of them have been bad decisions, I am sure."
"We didn't have the right skills, the right capacity, to deal with a reconstruction effort of this kind," she added.
Several Democrat senators accused the Bush administration of misleading the American people on the reasons for invading Iraq and giving shifting reasons to justify the war to oust Saddam Hussein.
Ms Rice defended the administration's decision to overthrow the Iraqi leader, who she said refused to account for weapons of mass destruction.
Asked whether she would follow Mr Powell's lead in arguing her case with the president if she disagreed with him, she said Mr Bush "expects my most candid advice".
But the government must ultimately speak with a single voice "with the president in the lead", she said.
During Tuesday's session, Ms Rice was composed and confident almost throughout, meticulously well-prepared and showing the quality of her much-heralded brilliant mind - and memory, says the BBC's Jill McGivering in Washington.
She turned easily from one part of the world to the next, from politics and military strategy to trade without consulting notes and with barely a stumble.
For eight hours of question and answer, her performance was nothing if not impressive, our correspondent says.
In her opening statement, she made it clear that she believed greater efforts should now be made to put America's case to the world and listen to the response.
"Our interaction with the rest of the world must be a conversation, not a monologue."
But she also said that in the first years of the 21st Century, liberty could be spread around the globe.
"To be sure, in our world, there remain outposts of tyranny, and America stands with oppressed people on every continent, in Cuba, and Burma, and North Korea, and Iran, and Belarus, and Zimbabwe," she said.
She was asked to explain whether the number of US troops sent to Iraq was adequate, whether the Iraqi forces being trained would be in a position to replace them, and whether she could outline an exit strategy.
She repeatedly declined to say when US forces might come home.
Discussing the administration's insistence before the Iraq war that Saddam Hussein possessed weapons of mass destruction, one senator aggressively suggested Ms Rice's loyalty to Mr Bush "overwhelmed your respect for the truth".
She denied that staunchly, telling Democrat Senator Barbara Boxer: "I really hope that you will refrain from impugning my integrity."