WASHINGTON -- Sophie Cruz's brief encounter with Pope Francis during his parade in Washington this week appeared to be the kind of spontaneous moment that is so endearing about this pope: an initially hesitant young child wrapping an arm around his neck as he offers a kiss and a blessing.

But for 5-year-old Sophie, the moment unfolded as perfectly as it was scripted by members of a coalition of Los Angeles-based immigration rights groups. They had been preparing for nearly a year for 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 using a 10-year-old girl with 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."

Get Breaking News Delivered to Your Inbox

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

Sophie was selected for the Washington trip because she "impressed us all so much that we felt she would be our best spokesman," Gutierrez said. If she had been unsuccessful in Washington attracting the pope's attention, he said, she would have traveled with the group to New York and then Philadelphia to try again.

A picture Sophie drew of Pope Francis. Courtesy Raul Cruz

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 their risk of being deported 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."

Gutierrez said Sophie crafted her own letter to the pope and wasn't prompted what to tell reporters who caught up with her later.

Sophie Cruz with her family. Courtesy Raul Cruz

"She didn't have anyone coaching her," Gutierrez said. "She just spoke from her heart. It all came from her."

The same group, which includes members of the Hermandad Mexicana Transnacional, 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.

"I told him please help my dad because he is gonna be deported and it's unfair that millions of children are also suffering in my same situation," Jersey recalled. "He kissed me on my forehead and he told me he was gonna talk with the president."

Following Jersey's encounter, a relative helped post bond for the jailed dad.

The group traveled to Washington with Sophie and her 36-year-old father, Raul, and sent Sophie to the popemobile with a bright yellow T-shirt with a message in Spanish asking Francis to "rescue DAPA." The message referred to Obama's now-stalled program Deferred Action for Parents of Americans and Legal Permanent Residents. It would allow millions of immigrants living in the country illegally to apply for permission to legally stay and work here. A federal judge in Texas temporarily blocked the effort in February as part of a lawsuit by 26 states challenging it.

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.

When Sophie made her first moves toward Francis' modified, open-air Jeep, a uniformed officer appeared to start walking her back to her father and others in her group still behind a security barrier. A different, suit-clad security agent also appeared to shoo the young girl, who appeared hesitant as the officials approached, before Francis himself beckoned her to the side of his Jeep.

Gutierrez said Sophie's success came from a "combination of factors, one being in the right spot at the right time." He added that he thinks Francis may also have remembered 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."