Corporate CEOs would have to appear in campaign ads they fund, under a political disclosure bill the House just passed by a narrow margin.

Democrats, hoping to rein in special-interest spending before November's midterm elections, pushed the measure, which would impose broad new disclosure rules on political spending.

The bill, approved by a 219-206 vote, was opposed by Republicans who cast it as violating free-speech protections and filled with exemptions for powerful groups, such as the National Rifle Association and labor unions. The measure was crafted by Democrats "to help their friends, while silencing their political opponents," House Minority Leader John Boehner, R-Ohio, said during floor debate today.

But the bill's chief architect, Rep. Chris Van Hollen, D-Md.,said the legislation would ensure "the voice of citizens is not drowned out by secret spending."

The legislation was crafted in response to a January ruling by the Supreme Court that cleared the way for unlimited spending by corporations and unions on campaign ads that oppose or support candidates.

The bill would require that most groups running independent ads to disclose their top five donors. Companies with government contracts worth more than $10 million, along with corporations receiving federal bailout money, would be barred from spending on such advertising.

The measure also bans companies with more than 20% foreign ownership from funding independent political activity.

The bill faced opposition from groups on the left and right after its sponsors exempted the powerful gun owners' and other large nonprofits from disclosure requirements as they worked to secure the support of more lawmakers. The U.S. Chamber of Commerce also sharply criticized the bill Thursday, arguing that a last-minute provision provided special treatment for labor unions.

The measure's prospects are uncertain in the Senate. Sen. Mitch McConnell, R-Ky., the chamber's top Republican, Thursday assailed the proposal as "protecting incumbent Democratic politicians."

No vote has been scheduled yet in the Senate, despite Democrats' hopes to pass the bill before lawmakers leave Washington for a July 4 break.

Updated at 6:25 p.m. ET: The bill also includes a provision pushed by Rep. Dennis Kucinich, D-Ohio, that singles out oil giant BP, the firm at the center of the massive Gulf oil spill, and other companies with federal leases that allow them to drill in the Outer Contintental Shelf. They would be barred from unlimited political spending. It was included in the bill on a voice vote Thursday.

"Energy companies may be able to drill for oil in the Outer Continental Shelf, but my amendment will keep them from drilling for votes in the Capitol at the same time," Kucinich said in a statement.

President Obama, who has made responding to the Supreme Court's campaign-finance ruling a top priority, hailed the bill's passage Thursday.

Here's the full text of Obama's statement:

I congratulate the House of Representatives on today's passage of the DISCLOSE Act, a critical piece of legislation to control the flood of special interest money into our elections. The DISCLOSE Act would establish the strongest-ever disclosure requirements for election-related spending by special interests, including Wall Street and big oil companies, and it would restrict spending by foreign-controlled corporations. It would give the American public the right to see exactly who is spending money in an attempt to influence campaigns for public office. The House bill is not perfect – I would have preferred that it include no exemptions. But it mandates unprecedented transparency in campaign spending, and it ensures that corporations who spend money on American elections are accountable first and foremost to the American people. I urge the Senate to act swiftly on its version of the bill, and I look forward to working with both chambers on prompt enactment of final legislation.

(Posted by Fredreka Schouten)