The Obama administration has set records for deportations, but the types of immigrants it is kicking out of the country has changed dramatically over the past four years, according to numbers the Homeland Security Department has had to turn over as part of a pending court case.

Records show that the number of regular deportations from within the interior the rank-and-file illegal immigrants who are living and working in the shadows has plummeted by 25 percent. Instead, the department has surged deportations along the borders.

That change means that illegal immigrants who successfully navigate the border are in less danger of being deported, unless they commit serious crimes that bring them to the attention of the federal government.

“They’re doing a different kind of enforcement that results in higher numbers, but there are definitely not more people being removed from the interior of the country,” said Jessica M. Vaughan, director of policy studies at the Center for Immigration Studies, who testified about the data in court last week.

Homeland Security officials had to turn over the in-depth deportation numbers as part of the case, which involves a challenge from Immigration and Customs Enforcement (ICE) agents and officers who say the Obama administration is preventing them from doing their jobs.

Under federal law, they say, they are required to arrest illegal immigrants they encounter, but they now fear being fired if they do so.

The change in deportations began four years ago but really stepped up in 2011, when the Obama administration issued guidance telling agents to stop deporting illegal immigrants unless they had major criminal records or had violated immigration laws repeatedly.

A Homeland Security spokesman pointed to Secretary Janet A. Napolitano’s testimony Thursday to Congress, where Rep. Lou Barletta, Pennsylvania Republican, asked about the deportation numbers. He said it appeared to show “the administration has cooked its removal statistics.”

Ms. Napolitano countered that a deportation is a deportation no matter where the alien is apprehended.

“The way I do my math is look at removals from the country, and we have removed more people from the United States than any prior administration,” she said, suggesting that it was Ms. Vaughan, not the Homeland Security Department, who “cooks her books.”

Ms. Napolitano said the criticism from both sides of the immigration debate suggests that “maybe we hit the sweet spot at some point.”

“We can get into the weeds on statistics,” she said. “The plain fact of the matter is that ICE ERO has been extremely active.”

ERO or Enforcement and Removal Operations accounted for more than 207,000 deportations in fiscal year 2010, or 53 percent of all removals. So far in fiscal year 2013, which began Oct. 1, ERO has accounted for just 38 percent of removals.