Gary Williams, who led the Maryland men’s basketball team back to national prominence and the 2002 national championship, is retiring after 22 seasons, the school announced Thursday afternoon.

Williams, 66, will speak at a press conference with Maryland Athletic Director Kevin Anderson and school president Wallace D. Loh at 1 p.m. Friday.

Gary Williams compiled a 461-252 record as Maryland’s head coach. (Jonathan Newton/THE WASHINGTON POST)

“I started thinking about it last year after we tied Duke for the ACC title,” Williams told The Post’s John Feinstein in a telephone interview. “I’ve been doing this a long time and I thought it might be time to do something else. After [Debbie] Yow left, I thought I might enjoy it more this year and I really did like working with Kevin Anderson. He’s a straight shooter. But I think I’d been worn down by the previous 15 years [with Yow]. It grinds on you.”

According to an individual close to the team, who asked not to be identified because of the sensitive nature of the situation, the team’s departing seniors met with Williams early Thursday afternoon to take their graduation photos. The person said Williams did not mention anything about retirement. But later, according to the source, Williams met with the team to tell the players he was retiring.

The news came as a complete shock, according to the source.

“Even towards the end of this year, he just started talking about next year and getting the guys ready for next year,” the source said. “I don’t know what happened. Maybe he just woke up and decide he was ready to be done.”

Williams will stay on at Maryland as an assistant athletic director and special assistant to Anderson.

“How many people do the same thing for 43 years? I’m sad I won’t be a part of it any more the way I have been and won’t have the relationships I’ve had with the players,” Williams told Feinstein. “But I’m looking forward to not always worrying about the next game, the next recruit, the next season. I can’t remember the last time in my life there wasn’t a ‘next thing,’ I had to be concerned about.

“I just talked to the players and that was hard. I told them I hoped they thought I’d given them everything I had and I knew this was tough but sometimes it’s a part of life. I know they’ll be fine and whoever comes in will make them feel good about themselves. Players are more resilient than old people are.

“I didn’t want to make a snap decision right at the end of the season. That’s never a good time to make a decision. I mean, I’m 66. Who is older than me in the business. [Connecticut Coach Jim] Calhoun? Okay. Boeheim? He’s spent his whole life in Syracuse; he doesn’t know any better,” Williams said jokingly about Syracuse Coach Jim Boeheim, one of his friends in the coaching business.

“I don’t want to still be trying to coach when I can’t even stand up and get off the bench. I’m lucky I’m healthy now but stress gets to you and you’re not guaranteed anything from one year to the next. It just felt like it was time. Honestly, it felt like it was time a year ago. Now, I’m certain it’s time.”

Williams told Feinstein he was going to consult with UnderArmour, which outfits Maryland’s athletic teams, in addition to fundraising for the school.

“I’ve been a fundraiser for the last 22 years here I should be able to do it,” Williams said, adding that he wants to do some TV and radio.

According to individuals familiar with the situation who were not authorized to speak on the record, Villanova Coach Jay Wright will be high on Maryland’s list to replace Williams.

Another individual close to the Maryland athletic department said Notre Dame Coach Mike Brey would be interested in the job should Maryland approach him. The Chicago Tribune reported Thursday that Maryland already had reached out to Brey, who was born in Bethesda and attended DeMatha, but that Brey and Notre Dame were working on a contract extension that would keep him in South Bend, Ind.

The source also believed Arizona Coach Sean Miller would express interest in the job, though Miller just completed only his second season as Wildcats coach.

Williams began his head coaching career in 1978 at American, spending four seasons as the Eagles’ coach. After that, he was head coach at Boston College from 1982 to 1986 and head coach at Ohio State from 1986 to 1989 before taking over at Maryland, which was still reeling from the death of Len Bias and the prospect of NCAA violations accrued during the three-year tenure of Bob Wade, who proceeded Williams at Maryland.

At the end of Williams’s first Maryland season in March 1990, Maryland received a two-year NCAA tournament ban for 18 violations committed by the program under Wade.

But, after losing seasons in 1991-92 and 1992-93, Williams led the Terrapins to the first of 11 straight NCAA tournament appearances in 1994. In 2001, Maryland finished 25-11 and advanced to its first Final Four, where it lost to Duke.

The next season, fueled by a group of players who were relatively unheralded coming out of high school but who completely bought into Williams’s system and mentality, Maryland won its first national title with a 64-52 win over Indiana.

Maryland saw a relative decline in on-court success in recent years. The Terrapins reached the Sweet 16 in the season after the national title and the second round of the NCAA tournament in the year after that. But Maryland missed the NCAA tournament entirely in four of Williams’s last seven seasons in College Park. This past season, in which the Terrapins went 19-14 and struggled to seventh place in the ACC standings, Maryland failed to reach both the NCAA tournament and National Invitation Tournament for the first time since 1993.

On Wednesday, Jordan Williams announced that he would keep his name in the NBA draft and would not be returning for his junior season. As a sophomore in 2010-11, Williams led the Terrapins in both scoring and rebounding. His departure left Maryland with a considerable void in its front court.

You can express your one-word reaction to Williams’s retirement in the form below. Friday morning, we will post a collection of reader responses so that you can see how fellow Terrapins and basketball fans feel about this end of an era.