WASHINGTON — NPR said Thursday it fired commentator Juan Williams because of a pattern of commentaries that violated the news organization’s guidelines, and not solely because of Williams’s statements about Muslims and terrorism on a Fox News program earlier this week.

Williams, meanwhile, said he is “outraged” and “brokenhearted” that NPR cut him loose after more than a decade as a radio host, correspondent and analyst. He stood by his comments and said they were taken out of context by NPR.

For its part, Fox News on Thursday awarded Williams a new multiyear contract worth nearly $2 million that will expand his role on the cable news channel and its website. In a statement that indirectly referenced his firing by NPR, Fox News chief Roger Ailes described Williams as “a staunch defender of liberal viewpoints” and “an honest man whose freedom of speech is protected by Fox News on a daily basis.”

NPR fired Williams, 56, late Wednesday after he appeared on Fox News’ “O’Reilly Factor” two nights earlier. In a discussion about terrorism with host Bill O’Reilly, Williams said, “But when I get on a plane, I got to tell you, if I see people who are in Muslim garb and I think, you know, they’re identifying themselves first and foremost as Muslims, I get worried. I get nervous.”

On Wednesday, CAIR, the Council on American-Islamic Relations, called on NPR to “address the fact that one of its news analysts seems to believe that all airline passengers who are perceived to be Muslim can legitimately be viewed as security threats.”

Later in the interview, however, Williams challenged O’Reilly’s suggestion that “the Muslims attacked us on 9/11,” saying it was wrong to generalize about Muslims that way, just as it was wrong to generalize about Christians, such as Oklahoma City bomber Timothy McVeigh, who have committed acts of terrorism. “There are good Muslims,” Williams said later, making a distinction from “extremists.”

Williams was both a senior news analyst for Fox and a regular commentator on contract with NPR. The dual roles have often placed him at odds with NPR, executives at the Washington-based organization said.

NPR officials said they have repeatedly told Williams that some of his statements on Fox violate NPR’s ground rules for its news analysts. The rules ban NPR analysts from making speculative statements or rendering opinions on TV that would be deemed unacceptable if uttered on an NPR program. The policy has some gray areas, they acknowledged, but it generally prohibits personal at-tacks or statements that negatively characterize broad groups of people, such as Muslims.

“We have made our policies clear to Juan in prior conversations and warnings, and he has continued to violate our principles,” said Dana Davis Rehm, an NPR spokeswoman. “When an analyst states personal opinions on an issue, our feeling is they have undermined their credibility as an analyst.”

One flash point for NPR in the past was Williams’ comments on “The O’Reilly Factor” in January 2009 about new first lady Michelle Obama. Williams said, “She’s got this Stokely Carmichael in a designer dress thing going on. Her instinct is to start with this ‘Blame America,’ you know, ‘I’m the victim’ (rhetoric). If that stuff starts to come out, people will go bananas.”

The comments brought “a huge storm of criticism” to NPR, even though Williams spoke on Fox, according to a senior news executive who asked not to be named because NPR hadn’t authorized him to speak on the record.

Williams’ comments Monday were the last straw, the executive said. He dismissed suggestions that NPR was suppressing Williams’ freedom of speech, saying, “Juan has a First Amendment right to say whatever he wants. He does not have a First Amendment right to be paid by NPR for saying whatever he wants.”

On Thursday, Williams said, “As a journalist, it’s unsupportable that your employer would fire you for stating your honest opinion, and I daresay your honest feelings, in an appropriate setting.”

He stood by his comments and said, “I think that I am open to being misinterpreted only if you snip one line out of what I said. But I would never guess that people who are professional journalists would just take one line and make me look bigoted so they can use it as an excuse to get rid of me.”

The firing brought swift condemnation Thursday from many quarters, but especially from conservatives, who have long accused NPR of liberal bias and have called for an end to federal subsidies of public broadcasting. The federal government provides roughly 15 percent of the revenue of public radio and TV stations, although less than 2 percent of NPR’s annual budget is directly subsidized by tax monies. The rest comes from corporate underwriting, foundation grants and programming fees from hundreds of NPR member stations. These stations, in turn, receive direct financial support from the Corporation for Public Broadcasting, the entity set up by Congress in 1967 to pass federal funds to stations.

Among others, former House Speaker Newt Gingrich, R-Ga., said on Fox News on Thursday that Congress should investigate NPR over the episode and “consider cutting off their money.”

South Carolina Republican U.S. Sen. Jim DeMint planned to introduce legislation to end federal funding for NPR, his spokesman Wesley Denton confirmed Thursday night. Denton said the senator would expand upon his proposal in a statement today.

This report includes information from the Associated Press and the New York Times.