Barack Obama's secretary for homeland security, Janet Napolitano, resigned on Friday to take a senior post running the University of California.

Napolitano, the first woman to hold the post, has been a close confidante to the president, leading the administration's response to natural disasters and terrorist threats.

She has also been a strong supporter of the comprehensive immigration reform proposed in a Senate bill, which would provide a landmark route to citizenship for millions of workers in the country illegally.

The timing of her departure could unnerve the White House, which is grappling with how to overcome opposition to wholescale immigration among House Republicans.

Obama said in a statement that Napolitano had dealt with "some of [the] toughest challenges" facing the US.

"Since day one, Janet has led my administration's effort to secure our borders, deploying a historic number of resources, while also taking steps to make our immigration system fairer and more consistent with our values," Obama said.

"And the American people are safer and more secure thanks to Janet's leadership in protecting our homeland against terrorist attacks."

The LA Times, which broke news of her resignation, said Napolitano had been head-hunted for president for the University of California, an unusual move given such posts are normally granted to senior academics.

"While some may consider her to be an unconventional choice, secretary Napolitano is without a doubt the right person at the right time to lead this incredible university," Sherry Lansing, the regent and former film industry executive who headed the search committee, said in a statement to the newspaper.

"She will bring fresh eyes and a new sensibility – not only to UC, but to all of California. She will stand as a vigorous advocate for faculty, students and staff at a time when great changes in our state, and across the globe, are presenting as many opportunities as challenges."

Napolitano, 55, a former governer of Arizona, has led the department for homeland security, which has an annual $60bn budget and 240,000 employees, since 2009.

She has had an often fractious relationship with Republicans on Capitol Hill, not least over her stance on immigration reform, which looks likely to become an issue of ongoing and protracted debate in Washington.

Brendan Buck, the press secretary for Republican House speaker John Boehner, tweeted: "Well, that'll be fun. A new DHS Secretary in the middle of the immigration debate."

Napolitano said she had been honoured to work for Obama during such an "important chapter" for the country.

"We have worked together to minimize threats of all kinds to the American public," she said.

"The department has improved the safety of travelers; implemented smart steps that make our immigration system more fair and focused while deploying record resources to protect our nation's borders; worked with states to build resiliency and make our nation's emergency and disaster response capabilities more robust; and partnered with the private sector to improve our cybersecurity."