Reflecting a war-weary nation, the US Senate has voted overwhelmingly for an accelerated withdrawal of US forces from Afghanistan after more than a decade of fighting.

The strong bipartisan vote of 62-33 sends a clear message to President Barack Obama and the military as they engage in high-stakes talks about the pace of drawing down the 66,000 US troops there, with a White House announcement expected within weeks.

Although the vote was on a nonbinding amendment to a defense policy bill, its significance could not be discounted amid the current discussions.

Thirteen Republicans, including Senator Richard Lugar of Indiana, the top GOP lawmaker on the Senate Foreign Relations Committee, backed the measure.

Senator Jeff Merkley, its chief sponsor, argued that al Qaeda is stronger in other parts of the world and that nation-building in Afghanistan has gone off track. His measure endorsed Obama's timetable to withdraw all combat troops by the end of 2014 but pressed for a quicker pace, without specifying how that would be achieved.

"It is time to end this war, end the longest war in United States history," Merkley said during Senate debate.

Defense Secretary Leon Panetta said the US will need to keep troops in Afghanistan even after the combat mission ends in 2014 because al Qaeda is still present in the country and is trying to strengthen its influence.

He would not say how many American troops he thinks will be needed to conduct that mission, nor did he mention a time period.

"The goal here is an enduring presence therefore that will direct itself toward three important missions. One is obviously counterterrorism to insure that we continue to go after whatever al Qaeda targets remain in Afghanistan," Panetta told reporters at a Pentagon news conference.

He added that the United States also will have to train and assist the Afghan forces while providing support.

The overall defense bill authorizes $631 billion for weapons, ships, aircraft and a 1.7 percent pay raise for military personnel. The White House threatened to veto the legislation in its current form, citing limits on the president's authority in handling detainees at the US military facility at Guantanamo Bay, Cuba, and restrictions on cuts to the Air National Guard and Air Force Reserve.

The Senate hopes to wrap up its version of the bill by week's end. It then would have to be reconciled with the legislation the House passed in May. The House bill calls for Obama to maintain a force of at least 68,000 troops through the end of 2014.