LOS REYES LA PAZ, Mexico -- A Harvard University student stuck in Mexico for months after breaking an immigration rule was told Tuesday that he will be allowed to return home to the United States.

The U.S. Citizenship and Immigration Service had declared that Dario Guerrero Meneses, an illegal immigrant, effectively deported himself when he crossed the border without permission to accompany his dying mother to clinics offering alternative treatments to cancer patients in Mexico.

His mother died in August, and the agency denied Guerrero's initial attempts to return home to his remaining family in California.

But only hours after The Associated Press reported on his predicament Tuesday, the agency sent Guerrero a letter through his attorney saying he had been granted humanitarian parole, and will be allowed to return after all.

"Oh my God. I don't know. I feel good!" Guerrero said as the news brought tears of joy to his aunts and cousins. "I'm excited to finally get back to my life."

This parole is temporary. It lasts for two years and does not give him legal residency, let alone a clear path to U.S. citizenship.

Guerrero, who was brought from Mexico to California by his parents at the age of 2 and only learned of his illegal status as a young adult, was one of hundreds of thousands of young people granted a reprieve from deportation in 2012 by the Obama administration.

"The U.S. Citizenship and Immigration Service did a great thing just a few minutes ago," his attorney Alan Klein said. "He should be back in America in a few days."

"This is the perfect (humanitarian parole) case," Klein added. "He knew that he could possibly give up his right to be here so he could take care of his mother. He's the reason we have immigration, and he's the reason we have a Statue of Liberty because he is what we want here."

Immigrants in Guerrero's situation aren't allowed to leave the U.S. without government approval, and Guerrero tried to get it. He said he applied through the normal process for travel permission, and then waited a month and a half for a response as his mother's life ebbed away. He twice submitted requests for fast-track handling, and was told to more fully document his mother's condition. He could have tried to plead his case in person but left instead.

"My mom had a lot of ups and downs," he said. "The decision to actually leave was made overnight."

Guerrero, who has been staying with his grandparents in a gang-controlled suburb of Mexico City, knew his effort to get an exemption from the rules was a long shot: Last year, the agency approved only about a third of the humanitarian parole petitions it received.

Agency spokesman Chris Bentley said earlier Tuesday that "immigration law is complex; anyone considering taking an immigration action needs to clearly understand the potential consequences of that action first."

Miami-based immigration attorney Ira Kurzban says it's not infrequent for immigrants to lose their legal status by leaving the country without permission. Some go on cruises thinking they haven't really left the U.S., or take off to handle family emergencies, only to discover that they are barred from returning for as much as 10 years.

"There's no question (Guerrero) didn't follow the rules. The question is what the penalty should be," Kurzban said.

Advocates say traveling should be made easier for immigrants who have lived in the U.S. for many years. Visas for skilled H-1B temporary workers already allow travel internationally without preapproval, and giving others this freedom would reduce heartbreak and add only minimal administrative work, Kurzban said.

But no such provisions were included in last year's immigration reform bills, and they aren't expected to be included in any executive action President Barack Obama might announce later this year. Kurzban thinks that's because the issue affects a relatively small group, and there are so many other priorities.

Guerrero's 16-year-old brother also was by her side when Rocio Meneses Diaz died Aug. 14 at the age of 41 in the central Mexican state of Guanajuato. As a U.S.-born citizen, he is allowed to travel freely. Their father, a building contractor in the U.S. illegally, stayed behind with their 9-year-old sister, also a citizen.

Guerrero now says he thinks his mother would have been happier living her final days in Southern California with her husband and children. "But then we still had hope - and if we delayed that treatment any longer because of immigration issues, I don't think I would have been able to forgive myself."

Guerrero's parents had kept his immigration status secret for years. They came clean only when he began taking community-college engineering classes while still in high school, and the Social Security number his parents submitted bounced back.

Before her death, Guerrero's mom opened up about the past and her reasons for leaving Mexico: Her father had been kidnapped twice; her father-in-law and other relatives faced extortion; armed thieves broke into her clothing and jewelry store, holding a knife to her stomach.

Guerrero recorded her stories and her struggle with kidney cancer, hoping to turn it into a documentary back at school. Now he'll be able to pick that up again when he returns to Cambridge, Massachusetts for Harvard's spring semester.

Former Harvard lecturer Eoin Cannon, who taught history to Guerrero, described him as "one of the most thoughtful and creative and original students that I had the pleasure of teaching," and "an exceptional writer." Guerrero tackled homelessness in one film, and co-produced "A Dream Deferred," a documentary about immigrants like himself at Harvard.

"He's as American as anyone I know," Cannon said. "The law needs to sort of recognize that and have a mechanism for accounting for that ... For the law not to be able to handle his kind of case is hurting America."