WASHINGTON — The House endorsed the continued war in Afghanistan Thursday despite acknowledgment from Republicans and Democrats that the American people are war-weary after more than a decade of conflict.

By a vote of 303-113, lawmakers rejected an amendment that would have swiftly ended combat operations in Afghanistan by limiting funds only to the “safe and orderly withdrawal of U.S. troops and military contractors from Afghanistan.”

More than 10 years after the Sept. 11 terrorist attacks, American public support for the overseas conflict has deteriorated. An Associated Press-GfK poll released last week showed that backing for the war has hit a new low and is on par with support for the Vietnam War in the early 1970s.

Only 27 percent of Americans say they support the war effort, and 66 percent oppose it, according to the survey.

“The American people are far ahead of Congress,” said Rep. Barbara Lee, D-Calif., sponsor of the amendment, who called on Congress to stand squarely with the American people. “It’s past time to end the war and bring the troops home.”

Opponents of the amendment conceded that the public has grown tired of war, but they argued against a precipitous withdrawal. “If we leave too early and the Taliban and al-Qaida return, more Americans will suffer,” said Rep. Mac Thornberry, R-Texas.

The vote came as the House considered a $642 billion defense budget for next year, debating more than 140 amendments to the far-reaching legislation. Final passage of the measure is expected today.

Rather than a speedy withdrawal from Afghanistan, the spending blueprint calls for keeping a sizable number of U.S. combat troops in the country.

The bill cites significant uncertainty in Afghanistan about U.S. military support, and says that to reduce the uncertainty and promote stability the president should “maintain a force of at least 68,000 troops through Dec. 31, 2014, unless fewer forces can achieve United States objectives.”

The United States has 88,000 troops there, and President Barack Obama envisions a final withdrawal of U.S. combat troops in 2014.

He signed an agreement this month with Afghan President Hamid Karzai on the role of America forces in counterterrorism and training of the Afghan military. The president insisted that the U.S. combat role was winding down.

In a series of votes late Thursday, the Republican-controlled House narrowly passed an amendment preventing federal agencies from requiring contractors to sign project labor agreements to secure federal contracts.

The agreements require contractors to negotiate with union officials, recognize union wages and generally abide by collective-bargaining agreements. The vote was 211-209.