The head of the Transportation Security Agency, a security unit created in response to the Sept. 11 terror attacks, has resigned effective immediately.

Transportation Secretary Norm Mineta accepted Under Secretary of Transportation for Security John W. Magaw's resignation Thursday and immediately appointed Admiral James M. Loy, who served as deputy director of the TSA, to take over.

"John Magaw is a dedicated public servant with a lifetime of achievement in the law enforcement field and we all owe him a debt for his role in the start-up phase of TSA," Mineta said.

Loy "has amply demonstrated his ability to motivate and manage a large federal agency when he was commandant of the Coast Guard," he added.

A senior administration official cited personal reasons for Magaw's departure, but sources close to the decision told Fox News that Magaw was asked to step aside because he failed to meet the deadlines set for increasing security around the nation's public transportation hubs.

A White House official said that Magaw's coronary problems — Magaw had bypass surgery a couple months ago — made it impossible for him to meet his deadlines, but the White House in no way encouraged him to step down.

Magaw was appointed in January to come up with solutions to increase security at the nation's airports, seaports, rail lines and borders. TSA is in the process of hiring 35,000 federal employees to act as airport screeners, and is trying to meet a year-end deadline for installing bomb-detection equipment in airports.

Sources said Magaw has complained privately that the deadlines set by the administration and Congress were unfair and unrealistic.

The resignation also comes as Congress is considering whether to move the TSA into the new Homeland Security Department, which is in the process of being created.

Before joining the Department of Transportation, Magaw served as director of the Bureau of Alcohol, Tobacco and Firearms and head of the Secret Service. He was also appointed to several executive leadership positions at the Federal Emergency Management Agency (FEMA), including senior advisor to the director of FEMA for terrorism preparedness and acting director.

Upon entering his post at the TSA in February, Magaw acknowledged that he was undertaking a major role in providing security for the nation.

"It doesn't happen too often in our government's history, but we're building an organization from scratch. It is the first creation of its kind since World War II. It is a monumental challenge, but, as any fire fighter, police officer or member of our military will tell you, America can meet any challenge, and meet it with stamina and excellence. We will do so at the Transportation Security Administration."

Fox News' Jim Angle, Carl Cameron and Catherine Herridge contributed to this report.