Washington (CNN) -- The House of Representatives voted Wednesday to strip $450 million from funds slated for a controversial program to build an F-35 Joint Strike Fighter second engine, a next-generation aircraft development program that has been riddled with cost overruns and labeled unnecessary by critics.

The amendment to strip the funds passed 233-198 with bipartisan support. It was added to a bill that would fund the federal government for the remainder of the current fiscal year. Neither the House nor the Senate has the passed the full spending package yet.

President Barack Obama has urged Congress to eliminate funding for the development of the second engine of the Joint Strike Fighter. House Speaker John Boehner, however, is a key supporter. The vote was a setback for the Ohio Republican.

Defense Secretary Robert Gates told members of the House Armed Services Committee earlier Wednesday that he considers the program "an unnecessary and extravagant expense, particularly during a period of fiscal contraction."

Congress has often proven reluctant to end major Pentagon projects, which can be an important source of local jobs and revenue.

CNN's Alan Silverleib contributed to this report