But after bringing credibility — and political cover — to Mr. Obama on immigration when she arrived at the White House in early 2009, Ms. Muñoz had her reputation as a fearless advocate for Latinos threatened by her defense of the president’s deportation policy. A little more than a year into the job, tempers flared to the point that Chris Newman, an advocate for the National Day Laborer Organizing Network, got into a yelling match with Ms. Muñoz during a session in the Old Executive Office Building about the impact of the deportations on families.

At the end of 2010, she faced a big setback: the Dream Act, a measure pushed by the White House to provide legal status for immigrants who arrived in the country as young children, failed in the Senate. “The people who were crying got hugs,” Ms. Muñoz said in January, recounting how Mr. Obama consoled her and others after the vote. The president said, she recalled, “Think of the civil rights movement and how long those battles took.”

Her battles were taking a very long time. In 2011, Ms. Muñoz was the designated administration official to defend the deportations — which often separated children from parents — in a tough PBS documentary, “Lost in Detention.” On camera, she said that hundreds of thousands of deportations had been mandated by Congress, and she left unstated the reality that being tough on deportation was critical to getting Republicans on board with an immigration overhaul.

Her difficult position was not lost on her friends. “You could see the pain in her face,” Ms. Kelley said, speaking of Ms. Muñoz’s demeanor under questioning in the documentary.

That summer, Ms. Muñoz helped the administration develop new policies aimed at making criminals and repeat border crossers the priority for deportation, but activists said they did little to stop families from being torn apart. “If she was on the outside, she wouldn’t have been chaining herself to the White House fence, but she would have been in the president’s face,” said Frank Sharry, another friend and immigration activist.

It was not until last summer, only months before the 2012 election, that the administration agreed to defer deportations of the young immigrants who would have been covered by the Dream Act. Ms. Muñoz has never publicly said how much she pushed the White House to ease up on the deportations.