US Homeland Security chief Janet Napolitano says she’s resigning to take up a job in academia, opening up a surprise vacancy in President Barack Obama’s cabinet.

Napolitano, a former governor of Arizona, said on Friday she was being nominated as the president of the University of California.

She has served as Homeland Security secretary since Obama took office in 2009.

“I thank President Obama for the chance to serve our nation during this important chapter in our history,” Napolitano said in a statement.

“I know the Department of Homeland Security will continue to perform its important duties with the honour and focus that the American public expects.”

Napolitano leaves at a crucial moment with a bid to reform the US immigration system under discussion in Congress.

The Homeland Security department plays a key role enforcing US border security, as well as protecting the United States from terrorist threats.

Obama said in a statement Napolitano had met some of the “toughest challenges” facing the United States.

“The American people are safer and more secure thanks to Janet’s leadership in protecting our homeland against terrorist attacks,” he said.