"I am signing an imperfect omnibus bill because it is necessary for the ongoing functions of government," he said Wednesday. "But I also view this as a departure point for more far-reaching change."
The president signed the bill in private, an indication of his discomfort with it, according to the Associated Press.
The president defended some earmarks when done right, but said that many have been "a vehicle for waste, fraud and abuse." He promised to work with Congress on further reforms to curb earmark abuse.
Listen to his remarks:
The spending bill approved by the Senate Tuesday night will fund all Cabinet departments except the Defense, Homeland Security and Veterans Affairs. It is six months overdue, because of partisan gridlock at the end of last year. Since last September, government agencies have been funded by a series of stopgap short-term funding bills.
"This has taken far too long," Senate Majority Leader Harry Reid of Nevada said before the final Senate vote on the bill Tuesday night, according to the Washington Post. "It's been difficult, but we're going to get it done."
The bill passed in a 63-35 vote, with eight Republicans joining 54 Democrats in favor. But in a sign of bipartisan support for curbing earmarks, three Democrats voted against the bill -- Sens. Russ Feingold of Wisconsin, Missouri's Claire McCaskill and Evan Bayh of Indiana.
The 1,132-page bill contains 7,991 earmarks totaling $5.5 billion, according to calculations by the Republican staff of the House Appropriations Committee, the AP reported.
Those earmarks include, for example, $485,000 for a boarding school for at-risk native students in Alaska and $1.2 million for the nonprofit Helen Keller International to provide eyeglasses to needy students, according to the AP.
The bill also includes big funding increases for many federal agencies and programs, including a $2.4 billion, 13 percent increase for the Agriculture Department, a 10 percent increase for the Amtrak passenger rail system, a $1.2 billion, 21 percent jump for the WIC supplemental nutrition program for women and children, and a 10 percent increase for housing vouchers for the poor.