WASHINGTON >> Sophie Cruz’s encounter with the pope during a parade in Washington this week looked to be one of those spontaneous, once-in-a-lifetime-moments Francis has become known for.

But for 5-year-old Sophie, the chance to wrap her arm around the pope’s neck as he offered a hug, kiss and a blessing unfolded as perfectly as it was scripted by members of a coalition of Los Angeles-based immigration rights groups. For nearly a year the group had been preparing the young girl from suburban Los Angeles to make a dash for the popemobile to deliver a message about the plight of immigrant parents living in the country illegally.

They had even pulled off a similar public-relations coup a year ago in Rome with a 10-year-old girl meeting the pope.

“We planned to do this from the moment we learned he was coming to the States,” Juan Jose Gutierrez of the Full Rights for Immigrants Coalition told The Associated Press. “We have been working for a while now trying to sensitize the American public that dealing with immigration is not just dealing with the people who came in without proper documents but that we also have … countless children whose parents are undocumented.”

Gutierrez said the group decided to use the children of immigrants to represent their push for an immigration overhaul to the pope, a staunch supporter of migrants. “We have been looking for children to make the case that we as adults have been making for years,” he said.

If Sophie had been unsuccessful in Washington attracting the pope’s attention, Gutierrez said, she would have traveled with the group to New York and then Philadelphia to try again.

Though initially hesitant as security officials approached along the parade route, Sophie refused to the leave the pope’s side Wednesday until a bodyguard took a handwritten letter and a T-shirt.

Her note to Francis detailed fears that her parents, immigrants from Mexico who don’t have legal status in the United States, could be deported. But that risk is slight under the Obama administration’s policies, which focus on deporting serious criminals.

“I believe I have the right to live with my parents,” Sophie told the AP after her moment with the pope. “I have the right to be happy. My dad works very hard in a factory galvanizing pieces of metal. All immigrants just like my dad feed this country. They deserve to live with dignity. They deserve to live with respect.”

Though Sophie was selected to hand-deliver an immigration message to Francis, Gutierrez said she crafted her own letter to the pope and wasn’t prompted what to tell reporters who caught up with her later.

“She didn’t have anyone coaching her,” Gutierrez said. “She just spoke from her heart. It all came from her.”

The same group orchestrated an equally successful effort in Rome last year with 10-year-old Jersey Vargas, who pleaded with Francis to urge President Barack Obama to free her immigrant father from a Louisiana detention center. Following Jersey’s encounter, a relative helped post bond for the jailed dad.

Since her moment with the pope was captured on live television, Sophie has been interviewed by a variety of news outlets, and Thursday she met with Mexico’s ambassador to the United States, Miguel Basanez.

Sophie and her supporters were preaching to the choir with Francis. In his remarks at the White House before the parade, the pope said, “As the son of an immigrant family, I am happy to be a guest in this country, which was largely built by such families.” And in a historic speech to a joint meeting of Congress on Thursday, he urged lawmakers to respond to the migration crisis in Europe and U.S. immigration issues “in a way which is humane, just and fraternal.”

As stage-managed as Sophie’s effort was, that the pigtailed-5-year-old was able to wriggle her way onto the parade route along Constitution Avenue and get the pope’s attention required a lot of luck considering the massive security entourage surrounding the pontiff.

Gutierrez said Sophie’s success was helped by “being in the right spot at the right time,” adding that he thought Francis may also have remembered meeting Jersey.

“When he saw this little girl,” Gutierrez said, “he had to have known in his heart that this was another important message in the form of a little girl.”