Rudy Giuliani says he wanted to deport all 400,000 illegal immigrants from New York City when he was mayor there, but federal officials' incompetence made him tailor policy friendly to immigrants.

The GOP presidential candidate, whose primary rivals have been hammering him for weeks for running a "sanctuary city" friendly to illegal immigrants, told FOX News contributor Bill Sammon that he had to accommodate illegal aliens because the feds would only round up to deport 700-1,500 each year.

"If they could [have deported them], I would have have turned all the people over. It would have helped me. I would have had a smaller population. I would have had fewer problems," Giuliani said in an interview given for Sammon's upcoming book, "Meet the Next President."

Click here to read the excerpt from Sammon's published in The Examiner.

Giuliani has faced heavy criticism from his more conservative rivals along the campaign trail for a number of moderate positions he has taken on immigration, homosexuality and abortion.

With respect to immigration, opponents offer a 1994 comment from the former New York City mayor to demonstrate his soft policy.

"Some of the hardest-working and most productive people in this city are undocumented aliens. ... If you come here and you work hard and you happen to be in an undocumented status, you're one of the people who we want in this city. You're somebody that we want to protect, and we want you to get out from under what is often a life of being like a fugitive," Giuliani is quoted as saying at the time.

In the interview, Giuliani laid blame on the U.S. immigration system, saying that the U.S. Immigration and Naturalization Service — now Immigration and Customs Enforcement — was unable to handle the crush of deportation referrals made by city law enforcement. Given that set of circumstances, he said he was left with a population that could either be marginalized or put under the law.

"My objective was to make New York City safe," Giuliani said, explaining that he'd rather have the estimated 50,000 to 60,000 illegal children in New York attending school than on the streets.