Despite several ugly recent episodes and considerable movement by conservative activists to defund it, federal funding for the Corporation for Public Broadcasting and National Public Radio survived an 11th hour deal on a spending bill to fund the government for the rest of the fiscal year.

The continuation of funding for public broadcasting is one of several significant victories for Democrats regarding the policy riders in the bill still emerging 12 hours after Democratic and Republican leaders struck a deal to avert government shutdown.

Another Democratic victory: of dozens of riders included in a House-passed spending bill curtailing strict new environmental regulations by the Environmental Protection Agency, zero were included in the final deal.

Several other controversial policy riders, including one to defund Planned Parenthood, America’s leading abortion provider, were used by Republican Speaker of the House John Boehner to secure steeper spending cuts in negotiations.

“The Speaker fought for the largest spending cut possible, and he fought for every policy restriction included in H.R. 1,” said Boehner spokesman Kevin Smith.

But NPR surviving stands out given the considerable momentum held by its critics following two recent episodes that brought its alleged liberal bias to national attention.

The first involved the firing of anchor Juan Williams for comments he made on Fox News regarding his experiences on airplanes.

“Look, Bill, I’m not a bigot. You know the kind of books I’ve written about the civil rights movement in this country. But when I get on the plane, I got to tell you, if I see people who are in Muslim garb and I think, you know, they are identifying themselves first and foremost as Muslims, I get worried. I get nervous,” Williams told Fox host Bill O’Reilly.

Critics blasted NPR not just for firing Williams over the comments, pointing out that Williams underlying point was how important it is to overcome unintentional feelings of nervousness.

NPR also drew criticism for the way it fired Williams: over the phone; the executive who fired him later resigned.

In a second episode, an undercover sting by conservative provocateur James O’Keefe caught a top NPR executive blasting the Tea Party as “racist” to what he thought was a Muslim group with ties to the Muslim Brotherhood contemplating donating $5 million.

Ron Schiller, the executive on the video, also said NPR would be “better off” without federal funding.

“Well frankly, it is clear that we would be better off in the long-run without federal funding,” he says. “The challenge right now is that if we lost it all together we would have a lot of stations go dark,” Schiller said.

Congressional sources said Democrats rallied behind federal funds for public broadcasting. A Democratic Hill aide said scores of voters from the district his boss represents called to advocate maintaining public funding.

One conservative activist closely following the debate said Democrats relied heavily on NPR to deliver political messages in their districts. In that sense, they were loathe to abandon a key communications platform.