Jeydon Loredo, who grew up female but now identifies as a male, and his mother had said the school district was not allowing his photograph because it violated "community standards."
But after a meeting late Friday afternoon, the La Feria school district agreed to let the photo be used in the yearbook, the Southern Poverty Law Center and the district announced.
The law center had threatened to file a lawsuit if a decision allowing the tuxedo photograph to be included wasn't made by Nov. 21.
In a telephone interview, Jeydon said he was "pretty happy" about the district's decision.
"It was just very frustrating, the whole thing. To me, it was just a simple answer that I wanted. But we got the answer. So it's great, man," said Jeydon, who is a senior at La Feria High School.
La Feria, a town of about 7,300 residents, is located about 30 miles east of McAllen.
Alesdair Ittelson, an attorney with the law center, said the district's decision sends "a signal to other school districts that transgender students should be recognized as important members of their communities rather than ostracized and subjected to discrimination. We applaud Jeydon's courage in standing up for his rights."
School district Superintendent Raymundo Villarreal Jr. said the resolution "is in the best interest of the student and the school and the community."
In a statement, the district said Jeydon was never in danger of "being completely excluded from appearing in the portrait section of the high school yearbook."
"There were discussions between the student, the student's family and the administration on options affiliated with a dress code, including options which were gender neutral," according to the statement.
Jeydon's mother, Stella Loredo, said that during a meeting with Villarreal, she was told that the photograph of her son in a tuxedo "goes against the community standards."
Villarreal told her that "they were a conservative school and that (outfit) wouldn't follow the school policy as far as their dress code," she said.
Stella Loredo said she was told her son's photograph would be included only if he wore feminine attire, such as a drape or blouse.
"It was frustrating," she said. "This has never happened in our small town. I kind of expected that it wouldn't go smoothly. But I'm happy that it has been resolved. And we got just what we wanted," she said.
In its statement, the district said that dress code issues "can be difficult and complicated. Oftentimes, an administrator is called to balance perceived community standards and individualized requests."
Ittelson said the district's action violated Jeydon's right to freedom of expression under the First Amendment, as well as the equal protection clause of the 14th Amendment and Title IX, the law requiring gender equity in every educational program that receives federal funding.
Jeydon, his mother and Ittelson appeared before the La Feria school board on Monday to appeal the district's decision. The school board did not take any action.
Jeydon said his friends and classmates were very supportive and he hopes his experience will educate school districts and prevent other students from going through what he experienced.
Jeydon's case is similar to others around the country in recent years.
In 2010, Constance McMillen successfully challenged a rural Mississippi school district's policy that prohibited her from bringing her girlfriend to the prom and wearing a tuxedo.
Also, in Mississippi in 2010, the American Civil Liberties Union sued the Copiah County School District on behalf of Ceara Sturgis. Sturgis' senior portrait was left out of the Wesson Attendance Center yearbook because she wore a tuxedo in the picture. The school district reached a settlement in that lawsuit.