Mayte Lara Ibarra
Mayte Lara Ibarra poses on graduation day. Twitter

A funny tweet from a Texas high school valedictorian turned out to be not so humourous and sparked a firestorm of controversy when she noted that she's an "undocumented" Mexican immigrant.

"Valedictorian, 4.5GPA, full tuition paid for at UT [University of Texas], 13 cords/medals, nice legs," boasted Mayte Lara Ibarra in a tweet the day she graduated from Crockett High School, before adding: "Oh and I'm undocumented."

The tweet won her hundreds of good wishes — along with a vicious backlash about her immigration status, reported KXAN-TV.

"After we deport you, perhaps you can return in a way that doesn't make you a criminal," tweeted one user. The teen's comment racked up some 30,000 retweets before Ibarra shut down the account — along with her Facebook page.

"I want all this attention from strangers to stop already," Ibarra said before closing her accounts.

Some infuriated by Ibarra's status even posted negative comments on the Facebook page of her employer, CVS Pharmacy. "Are you aware that you have an illegal alien working for you and bragging on Twitter about being undocumented!" wrote one woman.

A school spokesman said the University of Texas at Austin has "for decades granted two-semester tuition waivers to valedictorians of Texas public high schools, without regard to their residency status," adding: "State law also does not distinguish between documented and undocumented graduates of Texas high schools in admissions and financial aid decisions."

Texas is one of 17 US states to allow undocumented high school graduates to qualify for in-state tuition at its colleges.

While Ibarra is undocumented, she is not necessarily in the US illegally. Undocumented students are protected under the Deferred Action for Childhood Arrivals Program. The secretary of Homeland Security announced in 2012 that those who came to the US as children and meet certain guidelines may request consideration of deferred immigration action for up to two years.

It has been a stressful time for Ibarra, but not all bad. She has also received an outpouring of support.

"You are an inspiration," tweeted one supporter. "Your journey at The University of Texas hasn't started yet & you're already changing the world."