After publicly accepting an invitation to go to the James Madison High School prom with a 17-year-old student who asked him to the dance via Twitter, a popular Fairfax County School Board member has scaled back his plans for the event.

Ryan McElveen, 28, received the invitation from a Madison senior via a public tweet that showed her holding a poster that read “RYAN BE MYAN!!! Prom?” McElveen accepted the invitation May 11 by replying on Twitter: “It’s gonna get cray cray at Madison’s prom this year. I said yes.”

McElveen has since decided against attending the prom, but he will still make a brief appearance.

“After discussions with the student and administration, I figured my attendance would be more of a distraction and take away from students’ enjoyment of the event,” McElveen said Wednesday.

McElveen’s popularity among Fairfax County teens is unrivaled on the School Board. Students began flocking to his Twitter account in December after he announced via a tweet that classes would be canceled because of inclement weather before official word came from the school system.

McElveen has 22,900 Twitter followers — nearly three-quarters as many as the school system’s official account has at 31,400. (Fairfax County Public Schools)

He has 22,900 Twitter followers — nearly three-quarters as many as the school system’s official account has at 31,400. When he visits schools for School Board events, McElveen is frequently mobbed by students who ask to pose with him for selfies.

McElveen, who is married, confirmed that he had planned to attend the Madison High prom wearing his tuxedo. Instead, he will make a cameo appearance to take photos and said he does not intend to stay for long. The dance, with the theme “Secret Garden,” is scheduled May 30 at the Reston Hyatt.

McElveen had said his planned attendance at the prom would be similar to celebrities who have recently accepted Twitter invitations from teens across the country. Earlier this year, a Texas student asked a Houston Texans NFL cheerleader to prom and she accepted. Snowboarder Shaun White surprised one student in Philadelphia this month when he showed up at her prom. Even Vice President Biden has been the recipient of an elaborate “promposal.” He declined the invitation but sent the Connecticut teen a red, white and blue corsage.

McElveen said earlier this month that he had not spoken to the girl’s parents about attending the dance. The student’s mother said in an interview this week that her daughter had invited McElveen “as a joke.” “You know kids of this age,” she said. The family asked that The Washington Post not identify the girl because she is a minor.

In messages with The Post, the student wrote that she thought McElveen simply would be attending the dance much like other celebrities have attended proms.

“I just want to make something clear. Mr. McElveen is in no way whatsoever my ‘date’ because I believe that would be extremely inappropriate,” the student wrote. “This is basically just an invitation to him to come to our school prom. Also to be honest with you I didn’t think Mr. McElveen would see my tweet nevertheless respond to me.”

Schools spokesman John Torre said that the administration has no formal policy regarding schools officials attending student events such as prom. The attendance rules are set by individual schools, Torre said, and age limits vary. Guests and dates cannot be older than 21 for the Madison prom, Torre said.

School Board Chairman Ilryong Moon (At Large) declined to comment, and Madison’s principal, Mark Merrell, did not respond to a request for comment.

Susan Wisseman, president of the Madison PTSA, said that adults should lead by example. She said that her teenage daughter pointed out that even Miley Cyrus had declined a fan’s invitation to a prom.

“I saw the prom tweet and thought, ‘Ugh,’ ” Wisseman said. “I personally think the wiser choice would have been using Vice President Biden’s move by just arranging for a corsage. That would have been the appropriate adult choice.”

McElveen said his intention was to accept the Madison senior’s invitation as a nice gesture and to show that he is willing to reach out to students.

“I think we need an environment where kids feel comfortable reaching out to their elected officials,” said McElveen, who began his four-year term on the board in January 2012. “I simply see it as an opportunity to connect with students.”

A 2004 graduate of Marshall High School and a China researcher at the Brookings Institution, McElveen has leveraged his newfound popularity among teens to promote student engagement in School Board matters.

“My whole goal behind engaging students on twitter is get them involved and interested in the work of the School Board, which is no easy task,” McElveen said. “At the same time, a line does have to be drawn, because after all we often deal with personnel and discipline ­cases as well.”

McElveen said that he initially accepted the invitation because the teen was a “student who did not have a prom date and I have no reason not to accept.”

He noted that prom “is an opportunity for kids to have fun, and I don’t think my presence inhibits that. . . . I’m happy to entertain them” by making an appearance.