BOISE, Idaho -- A young girl whose custody case was ultimately decided by the Idaho Supreme Court traveled to Mexico earlier this week to begin living with a father she had never met before.

Maria Ramirez, 3, flew to Mexico on Monday and was handed over to her father, Jesus Ramirez, to begin a new life with him and his family in Salamanca, a small town in central Mexico, according to officials with the Consulate of Mexico in Boise.

In April, the Idaho Supreme Court ruled that a lower court erred in severing the man's parental rights even though he had never met his daughter, initially came to the U.S. illegally and was barred from ever returning. The Idaho Department of Health and Human Services argued to have the father's custody rights severed as the agency explored placement options for the child after officials removed the girl from the mother's home.

Mexican officials in Boise cheered the girl's transfer to her father's custody and the legal process that affirmed the rights of birth parents over questions of a parent's immigration status.

"As you might imagine, it was a very emotional moment for the father," said Mexican Consulate in Boise spokesman Sebastian A. Galvan Duque, whose colleagues were part of the team who traveled with the girl to Guadaljara this week.

"The (Supreme Court) decision sets forth an important precedent for similar cases in Idaho and strengthens the judicial framework which allows non-citizen parents to continue enjoying their parental rights," he said.

Robb Tilley, the Nampa attorney who helped on the case of Jesus Ramirez, did not immediately return messages left by The Associated Press on Thursday.

Ramirez married an Idaho woman in 2007, years after illegally entering the United States, according to court records. About a year later, he was forced by court order to return to Mexico and was joined on the trip by his wife. She became pregnant shortly afterward but returned to Idaho and gave birth to Maria in November 2008.

Jesus Ramirez tried to rejoin his family in March 2009, but was caught in Arizona and returned to Mexico, court documents show. That same month, Maria Ramirez was removed from her mother's home in Middleton, a small town in southwest Idaho, amid allegations of abuse and neglect. She was subsequently placed in protective custody after state officials found the mother wasn't providing adequate care.

The Idaho Department of Health and Welfare then began working on a case plan for the mother, aimed at reuniting mother and daughter. But at the same time, the father began seeking information and reached out to the agency, telling a caseworker he wanted his daughter to live with him.

By early 2010, the mother showed no signs of progress, prompting the state to begin terminating her custody rights. Agency officials also sought to terminate the father's parental rights, claiming he abandoned the child.

At the time, Maria Ramirez was living with a foster family whose mother was an employee at the agency and willing to provide a permanent home. Agency officials also claimed keeping the child in the U.S. was in her best, long-term interests.

Jesus Ramirez argued against the state's plan and initially lost when a magistrate judge determined that he couldn't support the child financially.

But the state Supreme Court disagreed and even questioned the state's motives in noting an agency employee had hopes of adopting the girl.

Tom Shanahan, spokesman for IDHW, said the court's ruling also reaffirmed an important lesson for the agency: the primacy of parental rights.

"It's the kind of thing that we'll for sure be paying more attention to, especially in situations like this ... when we have someone we're dealing with who doesn't live in the country," Shanahan said.

Also on HuffPost:

Loading Slideshow...
  • Amelia Reyes-Jimenez rides the bus to work in Zapopan, Mexico, Friday, Aug. 17, 2012. Reyes-Jimenez carried her blind and partly paralyzed baby boy, Cesar, across the Mexican border in 1995 seeking better medical care. She settled in Phoenix illegally and had three more children, all American citizens. In 2008 she was arrested after her disabled teen son was found home alone. Locked up in detention, clueless as to her rights or what was happening to her children, she pleaded guilty to child endangerment charges, and then spent two years trying to fight for her right to stay with her children. She lost and was deported back to Mexico without her children in 2010. (AP Photo/Dario Lopez-Mills)

  • This Aug. 14, 2012 photo shows Rony Molina holding a photo of his wife in his home in Stamford, Conn. Molina's wife, Sandra Payes Chacon, was deported to Guatemala in 2010, leaving Molina alone to care for their three children, all American citizens. (AP Photo/Jessica Hill)

  • Sandra Payes Chacon, wife of Rony Molina, poses for a portrait at a friends home in Atlixco, Mexico, Thursday, June 7, 2012. Sandra, who lived in the U.S. illegally, was deported to Guatemala a year and a half ago. She left behind her husband and her three children, all of them U.S. citizens. In the first six months of 2011, the United States removed more than 46,000 immigrants who were the parents of American-born children according to Immigration and Customs Enforcement (ICE). The number was first reported in a study called "Shattered Families" by the Applied Research Center, a New York-based social justice organization. Nearly 45,000 such parents were removed in the first six months of this year, according to the ICE. (AP Photo/Dario Lopez-Mills)

  • FILE - In this July 15, 2011 file photo, demonstrators hold signs in New York during a rally to condemn an immigration and customs enforcement program known as Secure Communities, and ICE's alleged refusal to meet with directly impacted immigrants. The signs read in Spanish "Deportations destroy our families." (AP Photo/Mary Altaffer, File)

  • Janna Hakim, 18, and her brother Sulaiman Hakim, 17, shows a picture of their mother Faten on Thursday, Aug. 16, 2012 in New York. On Aug. 13, 2010, Faten was taken away from home by ICE officials and deported to Ramallah, Palestine. (AP Photo/Bebeto Matthews)

  • In this March 1, 2012, children and their families take an adaptation course at the Binational Program for Migrant Education in the northern border city of Tijuana, Mexico. The program aims to ease the trauma of children who were deported from the United States and help them retake their studies in Mexico. In the foreground is Roxana Gomez from Guatemala, who is now studying the fourth grade at a primary school in Tijuana. (AP Photo/Alex Cossio)

  • In this photo taken April 23, 2012, a man who identified himself as Victor, left, sits on the stairs waits at the Casa del Migrante shelter for migrants, in Tijuana, Mexico. This haven for migrants that once sheltered mostly young people heading to America, full of hope, is now predominantly filled with men aged 30 to 40 years. Victor is staying at the shelter after he was deported from the U.S. and will try to cross back into the U.S. to reunite with his family. (AP Photo/Alex Cossio)

  • This undated photo provided by Felipe Montes via the Applied Research Center shows Montes and his wife, Marie Montes, and one of their three boys. When immigration agents deported Montes to Mexico two years ago, his three young sons _ American citizens _ were left in the care of their mentally ill, American-born mother. Within two weeks, social workers placed the boys in foster care. Montes and his wife want the children to live with him in Mexico, saying they are better off with their father than with strangers in the U.S. He works at a walnut farm and shares a house with his uncle, aunt and three nieces. But child welfare officials have asked a judge to strip Montes of his parental rights, arguing the children will have a better life here. Such a ruling could clear the way for their adoption. (AP Photo/Felipe Montes via the Applied Research Center)

  • In this Saturday, June 30, 2012, Juan C, 17, left, teaches his brother Miguel, 13, to box outside their home in Phoenix, Ariz. Juan was born in Michoacan and came to United States with his parents when he was 2-years-old. Flores who wants to become a professional boxer hopes to qualify for President Barack Obama Deferred Action program but he doesn't know if his charges for doing graffiti when he was younger will get in the way. Juan's father was deported five months ago and he has mixed feelings about applying for Obama's plan. (AP Photo/Nick Oza)

  • In this Tuesday, July 10, 2012 photo, Maria del Rosario Leyva, left, who returned with her 3-year-old boy and a 5-year-old girl from Santa Ana, California last year after their father, Marco Antonio Iglesias, right, was deported, try to get their children's U.S. birth certificates stamped by Mexican authorities in Malinalco, Mexico. Because of the Byzantine rules of Mexican and U.S. bureaucracies, tens of thousands of U.S. born children of Mexican migrant parents now find themselves without access to basic services in Mexico - unable to officially register in school or sign up for health care at public hospitals and clinics that give free check-ups and medicines. (AP Photo/Dario Lopez-Mills)

  • Norma Ramirez, center, in wheelchair, is embraced by her mother, Guillermina Clemente at the airport in Acapulco, Mexico, Monday April 16, 2012. Ramirez, an undocumented Mexican worker living in North Carolina who was facing an order of deportation, returned to her Mexico despite the fact that the Mexican consulate in Raleigh obtained a stay of her deportation order, when she learned she has terminal cancer and did not want to leave her U.S. born children alone in North Carolina. At left is the father of Ramirez, Margarito Ramirez Marquillo.(AP Photo/Bernandino Hernandez)

  • In this Dec. 20, 2010 photo, Lance Cpl. Aspar Andres speaks during a news conference concerning the deportation of his father, Juan Andres in Louisville, Ky. Family friend Jennifer Franklin sits at left. The Courier-Journal reports that Andres' 41-year-old father came here illegally from Guatemala as a teenager, more than 25 years ago. He was arrested recently after he accompanied a friend to a U.S. Immigration and Customs Enforcement office to act as a translator and it became apparent to an official there that he was in the country illegally. (AP Photo/The Courier-Journal, Frankie Steele) NO SALES; MAGS OUT; NO ARCHIVE; MANDATORY CREDIT

  • Al Okere, a 21-year-old college student at Central Washington University, walks out of his dorm building in Ellensburg, Wash., Thursday, Feb. 2, 2012. Okere, whose father was gunned down by police in Nigeria and whose mother was deported and now lives in hiding after losing her asylum plea, is hoping to avoid deportation himself. (AP Photo/Brian Myrick)

  • In this Jan. 4, 2012 photo, Jesus Gerardo Noriega, front, poses with his parents and brothers at the family home in Aurora, Colo. Jesus, 21, faced deportation last year after he was arrested for driving with no license plate light. Noriega's family brought him to the United States from Mexico when he was 9. His parents and three brothers live here legally, and he graduated from high school here. He learned in December that the case against him was being closed. He is pictured with brother Brian, mother Aracely, father Ricardo, and brothers Erick and Ricardo Jr. (AP Photo/Ed Andrieski)

  • In this Jan. 19, 2010 photo, Emilio Maya, left, tries to explain his complicated immigration situation to a relative in Argentina over the internet while his father, Emilio Maya, looks on at the Tango Cafe in Saugerties, N.Y. There was a time, when Emilio and Analia Maya's little Main Street cafe thrived and their dream of life in America seemed within reach. The brother and sister had settled in this picturesque village; he joined the volunteer fire department, she translated for the police. But they'd overstayed visitor visas and wanted desperately to fix their undocumented status. How? They made a deal with the department of Immigration and Customs Enforcement. In return for undercover tasks, they'd get work permits and eventually a special visa, they say agents promised. Years of clandestine assignments followed, a late-night stakeout at a house of prostitution and similar risky work. Then something changed. Emilio was seized by agents, including his handlers, and jailed to await deportation next month. His sister faces a hearing, too. (AP Photo/Seth Wenig)

  • Immigrants Fernando Miguel, right, with his father Rafael Miguel from Mexico, get help with documents and filling for the Deferred Action Childhood Arrivals applications at Casa de Maryland in Langley Park, Md., on Wednesday Aug. 15, 2012. Thousands of young undocumented immigrants lined up hoping for the right to work legally in America without being deported. The Obama administration's Deferred Action for Childhood Arrivals could expand the rights of more than 1 million young undocumented immigrants by giving them work permits, though they would not obtain legal residency here or a path to citizenship. (AP Photo/Jose Luis Magana)

  • Mexican citizen Elvira Arellano (L), a deported undocumented immigrant who spent a year living inside a Chicago church to avoid being separated from her US-born son, Guatemalan undocumented immigrant Mynor Montufar (R), the father of Rhode Island's first baby of 2008 and his Puerto Rican wife Carmen Marrero (C), are seen prior to the beginning of a meeting organized by the Guatemalan Congress' Migrant Commission on April 14, 2008 in Guatemala City. Mexican and Guatemalan congressmen are meeting to concur on joint actions to reach better treatment for migrants in the United States and the cessation of their deportations. EITAN ABRAMOVICH/AFP/Getty Images)

  • Daniela Pelaez

    In this Tuesday March 13, 2012 photo, Daniela Pelaez works on a school assignment at her home in Miami. Pelaez, who came to the United States from Colombia with her family when she was 4, is the valedictorian at the high school she attends and had been ordered to leave the country but will be allowed to stay for two more years after students at North Miami High School rallied around her, holding a protest and an online petition that collected thousands of signatures. (AP Photo/Wilfredo Lee)

  • FILE - In this Dec. 17, 2011 file photo, Tara Ammons Cohen reads with her son, Gavin, about a family friend in the local newspaper. Ammons Cohen was arrested in October 2008 on a drug charge and spent nearly three years locked up at the federal immigration detention center in Tacoma. She can'