Updated

Lauren Gray will get to stay in her adopted homeland after all, thanks to her newfound friends in high places.

Gray, of Trenton, Mo., was planning to leave Wednesday for England, where she lived until she was 4, after a bureaucratic quirk left her legal status in doubt. She came to the U.S. 17 years ago with her parents, who had a work visa that covered her until her 21st birthday, which came on Wednesday. Remaining here afterward would be illegal, and jeopardize her chance at a green card.

But widespread publicity about her plight spurred Sen. Claire McCaskill into action, and early Wednesday, the Democratic lawmaker gave Gray a welcome birthday present.

[pullquote]

“I made a personal call to [Department of Homeland Security Secretary] Janet Napolitano and brought Lauren’s situation to her attention and she agreed that it is young women like Lauren we want in the United States of America,” McCaskill said, adding that Gray will now be allowed to stay in the U.S. legally until her green card request works its way through the system. She will get a work visa that is renewable every two years.

“Sometimes this job can give you headaches and then there are other days, like today, that can be really rewarding,” McCaskill said. “I am very pleased that she will remain in the only country she has ever known.”

It came down to the wire for Gray, who ironically would have been in the clear had she been an illegal immigrant. Under the DREAM Act-style guidelines now being followed by the Obama administration, an illegal immigrant in her position can stay while following a path to citizenship. Earlier this year, the Department of Homeland Security ended its policy of deporting law-abiding illegal immigrants if they arrived as minors, graduated high school and have lived in the U.S. for at least five years before 2001, though the administration has denied the guidelines amount to amnesty.

While the DREAM Act was designed to apply only to illegal immigrants, the Obama guidelines do cover legal immigrants -- provided their immigration status expired prior to June 15.

Illegal immigrants can also obtain a five-year residency if they complete two years in the military or two years in a four-year institution of higher learning. Once they earn a degree or complete two years in good standing, they may qualify for permanent residency.

But not Gray, who moved to the U.S. with her parents, Ali and Ian, and her younger sister Gemma, after her grandparents came.

While her grandparents have been naturalized, Gray and her family are awaiting green cards. She thought she was about to get hers before her senior year in college, but one day her priority date got pushed unexpectedly.

"It was moving slowly. We were within nine months of priority date and we got bumped back two years."

"We've been through six lawyers and thousands upon thousands of dollars to make sure we did things right," Gray said. "I was just so angry -- infuriated."

"This underscores how complicated immigration law is and how, if we put band-aids on it, we'll draw the wrong conclusions," Michael Wildes, the former mayor of Englewood, N.J., and a prominent immigration attorney, told FoxNews.com. "We have become such a broken system."

But last week, Gray met her home-state lawmakers in Washington and pressed her cause to McCaskill, Sen. Roy Blunt, R-Mo., and Rep. Sam Graves, R-Mo. And on Wednesday, she got the news she can stay.

“I'm so relieved,” Gray told FoxNews.com.