As the deepening crisis in Japan presents the nuclear power industry with its gravest test in years, President Obama has emerged as a critical ally and defender.

Repeatedly in recent days, Obama has peppered public remarks on Japan with assurances that U.S. reactors are safe and that nuclear energy remains a key component of his energy agenda.

The president’s stance again puts him in direct opposition to many in his political base, with some environmentalists and a plurality of Democratic voters in a new survey saying that nuclear power is not safe. But Obama has experience with the industry. His home state of Illinois has more nuclear power plants than any other state, and Chicago is the headquarters for Exelon, which operates the country’s largest fleet of nuclear plants. And as president, Obama has proposed a dramatic expansion in government-backed loans to build new plants.

“I still think that nuclear power is an important part of our overall energy mix,” he told an interviewer this week from WVEC-TV in Norfolk. He added that “we’ve got to do it in a safe and sensible way.”

Asked about potential budget cuts to nuclear research by a local TV reporter from New Mexico, home to major atomic laboratories, the president said the Japan crisis was a reminder that funding was needed. “We’ve got a budget for it,” he said.

The president’s stance underscores the important role nuclear power plays in his broader energy agenda.

In the State of the Union speech this year, Obama presented a goal of generating 80 percent of the country’s electricity from clean energy sources by 2035. Citing support among different constituencies for wind, solar, nuclear, “clean coal” and natural gas, the president said: “We will need them all.”

Nuclear power already accounts for 20 percent of overall electricity in the United States and makes up the vast majority of carbon-free energy.

But because the cost of building a new reactor is so high — and Wall Street is reluctant to invest, with natural gas emerging as a more viable alternative — utilities have turned to the government for assistance. Obama has signaled his desire to help, proposing in his 2012 budget plan an additional $36 billion in loan guarantees to build new plants.

That would come on top of the $18.5 billion set aside as part of the loan guarantee program started under President George W. Bush’s Energy Policy Act of 2005.

Some critics have charged that Obama’s support for nuclear power can be traced to his political rise in Illinois, home to nuclear giant Exelon.

Those connections “run pretty deep,” said Kevin Kamp, with the watchdog group Beyond Nuclear. “That begins to explain his policy.”

Exelon has had ties to some of Obama’s closest advisers.

 David Axelrod, the president’s longtime political strategist and former White House adviser, co-founded a consulting firm that worked for Exelon, though Axelrod said Friday he currently has no private clients.

Rahm Emanuel, Obama’s former chief of staff and now Chicago’s mayor-elect, helped broker the deal that created Exelon when he worked at the investment bank Wasserstein Perella.

Exelon’s political action committee and its employees have given more than $340,000 to Obama’s congressional and presidential campaigns over the years, including $4,300 from Exelon chief executive John Rowe, according to Federal Election Commission records.

Since Obama became president, Exelon has sided with the White House in at least one major policy battle — quitting the U.S. Chamber of Commerce in protest of the trade group’s opposition to climate-change legislation. Exelon declined comment.

A White House spokesman, Clark Stevens, rejected the idea that Obama’s views on energy stemmed from anything other than sensible policy.

“The administration’s energy priorities are based solely on how best to build a 21st-century, clean-energy economy,” Stevens said via e-mail. “That policy is not about picking one energy source over another, in fact it is about setting a bold but achievable clean energy goal, and providing industry the flexibility on how best to increase their clean energy share through the responsible development of a broad range of energy sources — including renewables like wind, solar, and homegrown biofuels, as well as natural gas, clean coal, and nuclear power.”

Another major nuclear player is Duke Energy, whose chief executive, Jim Rogers, is helping to lead fundraising efforts for the 2012 Democratic National Convention in Charlotte. The firm, which slightly favored Democrats in its 2010 PAC donations, has agreed to guarantee a $10 million line of credit for the convention from a local bank.

Duke Energy officials say the effort is purely an economic development initiative. “We would do it for the Republicans in 2016 if they would consider Charlotte,” spokesman Tom Williams said. “It’s not a partisan effort at all.”

Overall, Obama has not relied very heavily on energy-related contributions in his political career, and his aides have pledged to continue refusing any corporate PAC donations in the 2012 campaign. Contributors in the energy and natural resources sector gave about $2.8 million to Obama in 2008, compared with $4.1 million for GOP candidate John McCain, according to the Center for Responsive Politics.

Obama’s stance has surprised some in the industry who weren’t sure what to expect when he entered office.

“The nuclear industry was a little bit nervous. We didn’t know what his policies would be,” said Eileen Supko, a nuclear engineer at the consulting firm Energy Resources International. “Everybody was pleasantly surprised and very pleased” by Obama’s agenda.

The president’s position appears to be in good stead with crucial independent voters, a majority of whom view nuclear as a safe energy source, according to a new Fox News poll. The survey found that a plurality of Democratic voters disagree.

Even before this week’s events in Japan, the White House had jousted with nuclear critics on Capitol Hill.

Last year, the White House rejected a request by Rep. Edward J. Markey (D-Mass.) to enforce a law passed in 2002 requiring that potassium iodide pills be made available to all U.S. citizens living within 20 miles of nuclear plants for use in case of exposure to radioactive iodine.

Markey said in an interview that he has asked the White House to reconsider that decision, which he said appeared to satisfy industry concerns that distributing the medicine “instills a fear of nuclear power” in people’s minds.

Staff writer Dan Eggen contributed to this report.