Comedy is Seth MacFarlane’s forte, but when it comes to politics, he’s a serious money man.

While building a multibillion-dollar entertainment franchise with the Fox animated series “Family Guy” at its center, MacFarlane has quietly become one of the largest political donors of his generation in Hollywood.

In 2005, at age 31, MacFarlane made his first contribution to the Democratic Party — a $2,500 check to its Congressional Campaign Committee. As his career skyrocketed, so did his donations, which now total $4.6 million, according to a Times analysis of federal campaign filings.

MacFarlane, 45, has donated mostly to Democratic political action committees, while directly supporting a small number of candidates. He was an early supporter of Barack Obama’s first presidential bid.

In 2015, he gave $2,700 to Bernie Sanders’ presidential campaign. A year later, he gave more than $716,700 to two political action committees supporting Hillary Clinton’s presidential bid.

After MacFarlane contributed $2.5 million to Democrats in 2018, his company, Fuzzy Door Productions, was ranked second in Hollywood giving behind DreamWorks SKG and ahead of Disney, according to data from OpenSecrets .org, a nonprofit research group tracking money in U.S. politics.

DreamWorks founders Steven Spielberg and Jeffrey Katzenberg have traditionally been the largest political givers in the industry, but MacFarlane is moving into their ranks.

From January 2005 through June 2019, Katzenberg donated $8.4 million to Democrats, The Times found. Spielberg gave $5.9 million, compared with $4.6 million from MacFarlane. One of MacFarlane’s Hollywood peers, J.J. Abrams, donated $2.2 million during that time period.

Since 1990, members of the entertainment industry have contributed more than $261 million to candidates and political action committees, with 81% of that money going to Democrats, according to data posted on OpenSecrets.org.

With an estimated $200-million net worth from TV shows (including the sci-fi comedy-drama series “The Orville”), movies “Ted” and “Ted 2,” and various jazz albums, MacFarlane’s entertainment empire has allowed him to back up his convictions with cash.

In addition to supporting Democratic PACs and candidates, MacFarlane also gave $2 million to National Public Radio and $500,000 to NPR station KPCC in June 2018 after Fox News host Tucker Carlson suggested that viewers ignore all other news outlets but his own. In 2016, he donated $200,000 to the Human Rights Campaign’s Equality Votes initiative to fund candidates who support gay marriage.

MacFarlane, whose TV shows are aired on Fox, declined to be interviewed for this article or to answer emailed questions.

His publicist, Joy Fehily, said MacFarlane was unavailable because he was “locked up in writing mode.” He believes in “putting his money where his mouth is,” Fehily said, but she would not specifically discuss his political contributions.

MacFarlane’s efforts — both creatively and politically — mirror those of his mentor Norman Lear, who started a national progressive movement based on the social issues raised in his sitcom “All in the Family” in the 1970s.

“I’ve always loved ‘Family Guy,’ ” Lear said. “Seth always has something on his mind and on his heart. And I think it shows in his work. I think it’s wonderful. I wish more people knew about his political giving. I think there’s a great deal of inspiration in that.”

MacFarlane’s views on politics have never been a secret. Throughout 17 seasons of “Family Guy,” which first aired in 1999 on Fox, MacFarlane has been unafraid in the show’s comedic presentation of almost any hot-button topic: gay marriage, the treatment of Native Americans, class struggles, legalized marijuana, wealth, poverty and medical debt.

He co-created “American Dad!”with showrunners Matt Weitzman and Mike Barker after George W. Bush won the 2000 presidential election. MacFarlane has said he hoped the show would allow him to turn his frustrations over the Bush administration into something profitable.

He has not hesitated to take on President Trump on his TV shows on Fox.

In January, “Family Guy” showrunners Rich Appel and Alec Sulkin dedicated an entire episode to skewering Trump and his family, along with Vice President Mike Pence, Russian President Vladimir Putin, Trump advisor Roger Stone and others. (The show received mix reviews from fans and TV critics.)

MacFarlane also is a prolific Twitter user, where he often complains about Trump and airs his views on politics.

Following the mass shootings in El Paso and Dayton, Ohio, MacFarlane tweeted: “Remember how angry you are today. Pack it up, store it, and pull it out again on every Election Day, every time. The people blocking common-sense gun legislation don’t just materialize out of thin air. We vote them in, actively or by inaction. We can vote them out.”

He added: “Might also be helpful to remind the country that thoughts and prayers are two different things.”

MacFarlane has yet to officially endorse any of the candidates running for president, but he recently tweeted, referring to Sanders and former Vice President Joe Biden: “From Biden to Bernie or anyone in between, whoever the candidate is, I’m behind them a thousand percent.”

As of the last campaign filing period, MacFarlane has donated $39,200 to the Lofgren Victory Fund, an effort started by Rep.Zoe Lofgren (D-San Jose) to help Democrats get elected to Congress.

After the first Democratic debate in Miami in June, MacFarlane mused about voters sticking with the front-runner. “My fear is that intellectual laziness will cause people to gravitate toward Biden alone as the ‘safe’ choice,” he tweeted. “You’ve met them all. Now do your homework.”

Recently, in response to people calling for Trump’s impeachment, MacFarlane tweeted that Democrats needed to “focus squarely on winning in 2020” instead.

“We’ve tried moderate and conservative presidents — let’s try a liberal for once. The question is who and how to win.”