WASHINGTON - War-weary Republicans and Democrats on Thursday sent the strongest message yet to President Obama to end the war in Afghanistan as the commander in chief decides how many U.S. troops to withdraw this summer.

A measure requiring an accelerated timetable for pulling out the 100,000 troops from Afghanistan and an exit strategy for the nearly 10-year-old conflict secured 204 votes in the House, falling just short of passage but boosting the hopes of its surprised proponents.

"It sends a strong signal to the president that the U.S. House of Representatives and the American people want change," Rep. Jim McGovern (D., Mass.) said shortly after the vote.

Obama is to begin drawing down some of the troops in July, with all combat forces due out by 2014. McGovern and others fear that the initial reduction will be a token cut of 5,000, numbers they argue fail to reflect that Osama bin Laden is gone and that the United States can't afford spending $10 billion a month on the war.

An Associated Press-GfK poll earlier this month found that 59 percent oppose the war and 37 percent favor it, with significant support for Obama's plan to start removing troops this summer. The poll's margin of error is plus or minus 4.2 percentage points.

Twenty-six Republicans joined 178 Democrats in backing the Afghanistan measure. Eight Democrats and 207 Republicans opposed it. In the Democratic-controlled House last July, a similar measure got 162 votes. The tally Thursday reflected the increasing exasperation in Congress with the costly war, even among the typically more hawkish Republicans.

But among the measure's foes, Rep. Mike Coffman (R., Colo.) said the accelerated timetable "would pull the rug out of the entire strategy," and Rep. Mac Thornberry (R., Texas) said, "The sacrifice of blood and treasure will be thrown away for considerable impatience."

The divisive issue was part of three days of debate on a broad, $690 billion defense bill that would provide a 1.6 percent increase in military pay, fund an array of aircraft, ships, and submarines, and increase health-care fees slightly for working-age military retirees. The bill meets the Pentagon's request for $119 billion to fight wars in Iraq and Afghanistan.

The House passed H.R. 1540, the military blueprint for the budget year beginning Oct. 1, on a vote of 322-96. Among 14 Philadelphia-area representatives, all voted yes, except Rep. Chaka Fattah (D., Pa.), who voted no.

In another sign of exasperation with war, the House overwhelmingly backed a measure barring any taxpayer dollars for U.S. ground forces or private security contractors in Libya with the exception of those involved in rescue missions of U.S. service members. The vote was 416-5.

Obama angered lawmakers with the amount of consultation with Congress before launching air strikes against Libya in March. Several members also have complained that Obama violated the 1972 War Powers Resolution, failing to seek congressional authorization for the U.S. military role in Libya.

Despite a veto threat, the GOP-controlled House moved ahead with several provisions in the bill that limit Obama's authority to reduce the size of the nuclear-weapons arsenal and decide the fate of terror suspects. The bill also would delay implementation of the president's new policy allowing gays to serve openly in the military and revives an extra engine for a new fighter aircraft that the Pentagon doesn't want.

The Republican-led House bill must be reconciled with a Senate version that is unlikely to include many of the divisive provisions. The Democratic-controlled Senate Armed Services Committee will begin crafting the bill the week of June 13.