The head of the troubled Immigration and Naturalization Service announced Friday that he'll retire at the end of the year, culminating a short term at the helm of an agency that critics said was ill-prepared for Sept. 11 and slow to react.

James Ziglar, who took over the job on Aug. 6, 2001, told President Bush in a letter that he will remain to assist with the transition to a new homeland security department. Ziglar said he plans to go into the private sector.

Ziglar, 56, was barely a month into the job when the attacks occurred, dramatically shifting his priorities from improving the agency's services for immigrants to implementing ways to better track foreigners and tightening the borders.

"Although I could not have imagined the events of Sept. 11 and the dramatic changes visited upon the Immigration and Naturalization Service, I have done my best to continue making progress toward the goals of restructuring the agency and reducing backlogs while responding to the call to arms in the war on terrorism,'' Ziglar said in his resignation letter, dated Thursday.

"I believe that the record will indicate that we have made substantial progress toward those goals,'' wrote Ziglar, who has been recovering from surgery he underwent in mid-July to repair a herniated disk in his lower back. The surgery is considered routine.

Ziglar said in a message to employees that Sept. 11 and the new homeland security department have changed the context of his mandate from Bush to restructure the INS.

"Knowing these goals will be successfully accomplished as part of a larger and stronger agency, it is an appropriate time for me to return to private life,'' Ziglar said in the memo.

Ziglar worked in the investment banking industry before becoming Senate sergeant-at-arms in 1998. He also is a lawyer and has held other federal government jobs.

The INS received strong condemnation from members of both parties after it was learned that 15 of the 19 Sept. 11 hijackers entered the United States legally on travel visas. Three were admitted with business visas and the 19th entered on a student visa.

Ziglar said most of the hijackers still were legally in the country when the attacks occurred.

The INS has long been viewed by many in Congress as a mismanaged agency. When Bush tapped Ziglar to head the INS, it was thought he might enjoy a better relationship with lawmakers.

Ziglar had no experience with immigration issues, but as the Senate's sergeant-at-arms, he enjoyed a close relationship with many lawmakers.

Attorney General John Ashcroft praised Ziglar for his service under "extraordinarily difficult circumstances.''

Ziglar's childhood friend, Senate Minority Leader Trent Lott, R-Miss., and Senate Majority Leader Tom Daschle, D-S.D., both endorsed Ziglar at his Senate confirmation hearing.

But Ziglar often found himself at odds with House Judiciary Committee Chairman James Sensenbrenner, R-Wis., whose panel oversees the INS.

Sensenbrenner was determined to dissolve the INS and create two agencies, one for immigration services and the other for enforcement. The Bush administration wanted to restructure in-house, leaving the INS intact.

Sensenbrenner was traveling and not immediately available for comment.

Under House legislation creating the new homeland security department, INS enforcement duties would be absorbed into the new agency and the immigration-services function would remain under the supervision of the Justice Department. The Senate will take up homeland security after the August recess, and may not go along with the House plan.

Joe Karpinski, Ziglar's congressional liaison, said Ziglar's accomplishments — such as establishing an office for juvenile immigrants and improving the Border Patrol chain of command — have been overshadowed by fallout from the terrorist attacks.

Sen. Edward M. Kennedy, D-Mass., chairman of an immigration subcommittee, said he was saddened by Ziglar's decision. Ziglar has "always remembered that immigration is not the problem, terrorism is,'' Kennedy said in a statement.

Meantime, the INS is moving ahead with plans to better track visitors to this country.

Ziglar has promised to have a foreign student tracking system ready by the beginning of the year and has proposed regulations for restricting how long foreigners can visit the United States on tourist and business visas.

Ziglar also rededicated the agency to putting in place a high-techology system for keeping track of when foreign visitors enter and exit the country. He also has sought and received money to hire more Border Patrol agents and to raise their salaries.