President Obama and Janet Napolitano / Win McNamee, Getty Images

by David Jackson and Alan Gomez, USA TODAY

by David Jackson and Alan Gomez, USA TODAY

It seems fitting that Janet Napolitano chose to leave her post at a time when Congress is debating the issue that largely defined her tenure: immigration.

The Department of Homeland Security has massive responsibilities, including counterterrorism, natural disasters and airport security; but Napolitano spent much of her four-plus years fielding attacks from both the right and the left over immigration - for either doing too little or too much to secure the nation's border and deport undocumented immigrants.

"Secretary Napolitano has one of the most challenging jobs in Washington," said Ali Noorani, executive director of the National Immigration Forum

Napolitano also drew praise for her department's response to natural disasters and terrorist threats, though some Republicans challenged her over the latter.

The former Arizona governor had to answer critical questions after the Boston Marathon bombing in April about how one of the suspects - Tamerlan Tsarnaev - was able to re-enter the country after a trip to Russia despite the raising of some red flags.

Perhaps her lowest point: saying "the system worked" after the nation narrowly avoided the bombing of an airplane over Detroit on Christmas Day 2009.

In a statement, Napolitano said her department made the immigration system "more fair and focused," improved the safety of air travel, worked with states on better responses to tornadoes and hurricanes, and focused on cybersecurity.

"I know the Department of Homeland Security will continue to perform its important duties with the honor and focus that the American public expects," Napolitano said.

In praising Napolitano's performance, Obama said her "portfolio has included some of the toughest challenges facing our country," and "I've come to rely on Janet's judgment and advice."

Rep. Jeff Duncan, R-S.C., chairman of a House subcommittee on homeland security oversight and management efficiency subcommittee, said Napolitano's department lacked transparency and refused "to acknowledge the threat posed by radical Islamic terrorists." Duncan also called the department generally disorganized.

When it came to immigration, Napolitano's department made big changes in how the nation identifies and deports people who are in the country illegally. Under new directives issued in 2011, immigration officials are to focus their enforcement efforts on a few categories of undocumented immigrants, including serious criminals, recent border-crossers and those who pose a threat to national security.

The result is that 55% of undocumented immigrants deported in 2012 were convicted criminals, compared with 33% in 2008. Still, the fact that authorities were not targeting all undocumented immigrants for deportation led Sen. Jeff Sessions, R-Ala., one of her most vocal critics, to say her tenure "was defined by a consistent disrespect for the rule of law."

She received few warm wishes from immigration advocacy groups. The administration has continued to deport about 400,000 immigrants annually throughout Napolitano's four years, prompting constant protests from those who feel her agencies never truly eased up on deportations and continued breaking up families.

Chris Newman, legal director for the National Day Laborer Organizing Network, summed up her tenure as an "unmitigated disaster" and "we are pleased to see her go."

The one bright spot on her record for immigration advocates was how she oversaw President Obama's 2012 directive to stop deportations of undocumented immigrants brought to the country as children. The Deferred Action for Childhood Arrivals program, known as DACA, has now approved more than 365,000 applications from those young immigrants to they can remain in the country without fear of deportation.

In speeches, press conferences and testimony before Congress, the former border-state governor repeatedly insisted that the U.S. border with Mexico was "more secure than ever."

Judging solely on the number of people apprehended trying to cross the border illegally, that statement would hold true. From 2008 to 2012, the number of people captured by Customs and Border Protection fell from 723,825 to 364,768.

Napolitano has said that's due to investments along the border made by the Obama administration, including more Border Patrol agents, surveillance technology and partnerships forged with local agencies throughout the border regions.

But critics have questioned her claims. Some say that the drop in illegal immigration was simply due to the downturn in the economy that eliminated many of the jobs immigrants come to perform. Others say the border remain as porous as ever.

"The border is nowhere near secure," Sen. John Cornyn, R-Texas, told her during a recent Senate hearing.

Airport security also marked Napolitano's years as Homeland Security secretary.

Under her tenure, the Transportation Security Administration routinely got complaints about long lines, officers groping passengers and scanning with machines that provided nearly nude images of travelers. But those complaints have quieted since John Pistole, a former deputy director of the FBI, started heading the agency in July 2010.

Under Pistole, TSA created Pre-check to expedite screening for frequent fliers for specific airlines at specific airports. Pistole also expedited screening for passengers over 70 years old, younger than 12 and those serving in the military.

Pistole has phased out the full-body scanners that produced nearly nude images, in favor of scanners to produce cartoon images.

Travelers will remember Napolitano's voice from the "If you see something, say something" public outreach campaign her department initiated to get more Americans to watch for suspicious activity in public places. Napolitano also appeared in videos played at major events, including the recent NCAA men's basketball tournament.

Napolitano's department has won praise for the performance of the Federal Emergency Management Agency under Administrator Craig Fugate.

That includes responses to Hurricane Sandy's destruction of the New Jersey coast in 2012 and Hurricane Isaac the same year, which made landfall as DHS was busy trying to secure the sites of the Democratic and Republican national conventions.

Napolitano had strong, bipartisan political connections that largely insulated her from some political attacks. Sen. John McCain, R-Ariz., a fellow Arizonan, said he's had his share of disagreements with her, but "I have never doubted her integrity, work ethic or commitment to our nation's security."

In announcing Napolitano's appointment, the University of California listed McCain as a reference for reporters. Other references included her two Republican predecessors in the job, Michael Chertoff and Tom Ridge.