American flags made in foreign lands will no longer fly over military bases, but the rule won't apply to other federal facilities because lawmakers decided star-spangled banners made in the U.S. are just too expensive.

Under a new law signed as part of the 2014 omnibus appropriations bill, any flag purchased by the Defense Department is required to be 100 percent made in America. Rep. Mike Thompson, D-Calif., who wrote the legislation, said he did so for economic as well as symbolic reasons.

"I thought it was appalling our Department of Defense would have flags made in other countries," Thompson, told CBS San Francisco shortly after the legislation was signed into law Wednesday. "But it's also important because we need to be making more in America."

But another bill that called on a blanket rule for all government agencies to only use flags made in America fell short. As a result, the flags that fly above military installations in the U.S. and around the world will have to be American made, but banners above other federal buildings will not. A prior law requiring  flags purchased by the federal government to be made of at least 50 percent of materials made in the U.S. does still apply to federal buildings outside the Pentagon's purview, however.

The legislation has been historically difficult to pass in part due to trade agreements, as well as the fact that flags made in China, the largest importer, cost significantly less than ones produced in the United States. An estimated $3.3 million worth of American flags are imported from Beijing each year.

Thompson, a Vietnam War veteran and Purple Heart recipient, wrote the legislation and applied it to the 1941 Berry Amendment. The amendment largely bans the Defense Department from buying items like food and clothing from foreign countries, the report said.

Dale Coots, marketing manager for Annin Flagmakers, in Roseland, N.J., said the new legislation is a positive step, but says other issues regarding flag imports remain unresolved, including the Federal Trade Commission’s lack of enforcement on flag labeling.

"An American flag is considered a textile," she said. "And a lot of flags that sell online don't have any origin label, which is required under U.S. law."

Annin Flagmakers, which has produced American flags since the 1820s, will not benefit from the new law because the company employs more than 500 workers. The federal government only takes bids from small businesses in flag purchases, she said.

Foreign-made American flags became an issue in the aftermath of 9/11, when Americans were flocking to stores to purchase flags to fly on their homes or cars. U.S. manufacturers could not keep up with the demand, so China stepped in. Foreign imports of the flags were generally valued at about $1 million a year, but surged to a staggering $52 million in the weeks that followed.

Fox News' Edmund DeMarche and the Associated Press contributed to this report