President Obama on Wednesday signed a $410 billion spending bill to keep the government running through the end of the fiscal year, despite complaints that the package was filled with thousands of earmarks. 

The president earlier defended the bill, which he called "imperfect" but necessary. But at the same time he announced new reforms he said would prevent wasteful earmarks in the future. 

The president did not make any pledge to eliminate earmarks or reduce them. Rather, he and House Democrats announced new reforms to subject them to greater scrutiny and transparency. 

"Done right, earmarks have given legislators the opportunity to direct federal money to worthy projects that benefit people in their district, and that's why I have opposed their outright elimination," Obama said. "But the fact is that on occasion, earmarks have been used as a vehicle for waste, and fraud and abuse. Projects have been inserted at the 11th hour, without review, and sometimes without merit, in order to satisfy the political or personal agendas of a given legislator, rather than the public interest." 

Obama said the reforms would require lawmakers seeking earmarks to post them on their Web sites in advance, so the public and press can review them. He said each earmark should be "open to scrutiny" at public hearings. 

"If my administration evaluates an earmark and determines that it has no legitimate public purpose, we will seek to eliminate it," Obama said. 

He also said all earmarks for for-profit companies should be subject to competitive bidding requirements. 

"The awarding of earmarks to private companies is the single most corrupting element of this practice," Obama said. 

The announcement came after Congress passed the $410 billion spending package Tuesday night. Taxpayers for Common Sense estimated the package contained 8,570 disclosed earmarks worth $7.7 billion. 

"I am signing an imperfect omnibus bill because it's necessary for the ongoing functions of government," Obama said, adding that he would use it as a "departure point" for enacting new reforms.  

He did not respond to a question asking why was not signing the spending bill in public. 

Sen. John McCain, R-Ariz., who opposed the earmarks in the bill, criticized his former election opponent Wednesday for not pledging to "use his veto pen" to stop pork-barrel projects. 

"The president's rhetoric is impressive, but his statement affirms we will continue to do business as usual in Washington regarding earmarks in appropriations legislation," he said in a written statement. "This is an opportunity missed."

The 1,132-page bill has an extraordinary reach, wrapping together nine spending bills to fund the annual operating budgets of every Cabinet department except Defense, Homeland Security and Veterans Affairs. Among the many earmarks are $485,000 for a boarding school for at-risk native students in western Alaska and $1.2 million for Helen Keller International so the nonprofit can provide eyeglasses to students with poor vision. 

Most of the government has been running on a stopgap funding bill set to expire at midnight Wednesday. Refusing to sign the newly completed spending bill would force Congress to pass another bill to keep the lights on come Thursday or else shut down the massive federal government. 

The $410 billion bill includes significant increases in food aid for the poor, energy research and other programs. It was supposed to have been completed last fall, but Democrats opted against election-year battles with Republicans and former President George W. Bush

The measure was a top priority for Democratic leaders, who praised it for numerous increases denied by Bush. It once enjoyed support from Republicans. 

But the bill ran into an unexpected political hailstorm in Congress after Obama's spending-heavy economic stimulus bill and his 2010 budget plan, which forecast a $1.8 trillion deficit for the current budget year. 

The bill's big increases -- among them a 14 percent boost for a popular program that feeds infants and poor women and a 10 percent increase for housing vouchers for the poor -- represent a clear win for Democrats who spent most of the past decade battling with Bush over money for domestic programs. Republicans, though, had called on Obama to veto the measure. 

The Associated Press contributed to this report.