The House of Representatives Appropriations Committee voted 33-13 to include the Guantanamo amendment in the $570 billion annual defense appropriations bill.
The Guantanamo detention camp, much criticized by human rights groups and others, has been back in the spotlight since May 31, when Sergeant Bowe Bergdahl was released after being held for five years by the Taliban.
Bergdahl was exchanged for five Taliban prisoners transferred from Guantanamo to Qatar.
Congress was not informed in advance about the transfer, despite a provision included in an earlier defense bill and signed into law by President Barack Obama requiring that legislators be given 30 days' notice before any prisoner leaves the detention center.
News of the swap infuriated many lawmakers, particularly Republicans already skeptical about the avowed intention of Obama, a Democrat, to close the Guantanamo facility.
Obama signed an executive order the day he became president to close the military prison, but it is still open more than five years later. Congress has blocked efforts to move toward closing it, such as a plan to transfer inmates to a U.S. prison or try them in federal courts.
Separately on Tuesday, 12 Republican members of the Democratic-controlled Senate introduced a resolution calling for a probe into the release of the five Taliban prisoners from Guantanamo.
"It's clear that the president wants to close down Guantanamo Bay, but I didn't think he'd violate the law to get that process started," Iowa Republican Senator Chuck Grassley, a co-sponsor, said in a statement.
The chairman of the House Armed Services Committee has already promised an investigation in the Republican-controlled House.
The political firestorm has raised concerns that it will be even harder to close the Guantanamo camp.
Advocates for closure say the detention facility, where prisoners on hunger strike have been force fed, violates U.S. principles such as not holding prisoners without charge. They claim it also acts as a recruiting tool for anti-American militants and is very expensive to keep open.
"It's clearly in the U.S. national security interest to close Guantanamo. The president and many senior military agree with that. And it would be a disgrace if the politicization of this exchange derailed those efforts," said Laura Pitter, senior national security counsel at Human Rights Watch in New York.
The House amendment was introduced by New Jersey Republican Representative Rodney Frelinghuysen.
The full House is expected to vote on the defense appropriations measure next week.