Antoine Brooks Jr. grabs the game-clinching interception intended for Texas wide receiver Lil’Jordan Humphrey. (John McDonnell/The Washington Post)

By the time Antoine Brooks Jr. hit the soggy turf with the ball in his hands, he knew. So did his Maryland teammates, who quickly swarmed the junior defensive back. Brooks had ended what could have been Texas’s game-winning drive with a leaping interception to seal an upset win.

The Terrapins still needed to take their second and final snap from the victory formation, but on the sideline, Ellis McKennie, a high school teammate of Jordan McNair, had already begun to wave the red flag emblazoned with McNair’s No. 79.

“Yes, thank you,” Brooks’s mom, Keisha Staples, remembers thinking. “Something good for these kids. Finally, something good for these kids.”

Brooks’s interception capped a strong fourth-quarter defensive effort that led to Maryland’s 34-29 victory over the No. 23 Longhorns at FedEx Field on a day full of seen and unseen tributes to McNair, the 19-year-old offensive lineman who died in June after suffering heat stroke at a workout.

Underneath his jersey, Brooks wore a red shirt that featured a picture of McNair. Brooks’s dad, Antoine Brooks Sr., had pressed the photo onto the shirt in his basement. With a faded version of the Maryland state flag added as background, the shirt shows McNair kneeling at a high school game, a water bottle in one hand and his helmet in the other.

The celebration on the field and in the locker room included “smiles, tears, joy, a lot of mixed emotions coming from 100-and-something of my teammates,” Brooks said, adding that the entire season will be dedicated to McNair.

“You’ve got to go through something to get closer to people, period,” Brooks added. “We’ve been through a lot.”

Last season, the Terps gave up 37.1 points per game, which ranked 120th out of 130 teams in the top-tier Football Bowl Subdivision. Against Texas, the Terps forced three turnovers in the final seven minutes to bolster an offense that in the game’s later stages struggled to piece together productive drives. It wasn’t perfect — Maryland allowed 405 yards and at one point surrendered 22 straight points (including two on a safety) to fall behind — but the victory nonetheless showed improvement. The Terps will try to build on that success at 6 p.m. Saturday at Bowling Green (0-1).

“Our players weren’t going to be denied,” interim head coach Matt Canada said. “Great credit to our defense.”

Brooks, who had a breakout season last year when he ranked second on the team with 77 tackles, views himself as one of its leaders.

In addition to the interception against Texas, Brooks led the team with 11 tackles, and he was honored as Big Ten co-defensive player of the week. When Maryland began last season with a road upset of the Longhorns, Brooks returned a blocked field goal for a 71-yard touchdown.

“Texas should forever remember his name,” Brooks’s dad said with a laugh.

Brooks, a native of Lanham, didn’t decide to play for Maryland until a few days before Signing Day of his senior year. He had committed to Buffalo and felt tied to that school because it never wavered with its scholarship offer when other schools did after Brooks suffered a devastating injury.

As a high school senior who also played quarterback, Brooks suffered a gruesome compound fracture in his ankle, as well as a broken wrist, when he was hit while scrambling during a game. His season ended, and most schools stopped calling. For a brief period, Brooks wondered whether he even wanted to continue playing football.

Maryland didn’t show much interest until January 2016, just after the school hired DJ Durkin as coach. Once Brooks arrived home after his visit to College Park that month, his mom encouraged him to do what was best for himself. Staples called her son’s high school coach, Dameon Powell, who took Brooks for a ride and helped him work through the decision.

“He loved Maryland, no question,” Powell said. “But he was loyal because Buffalo was there the whole time and never left. . . . He didn’t care [about] the level of play, because he knew wherever he was going to go, he was going to shine.”

That night, Brooks called Durkin with his decision, the beginning of what became a successful career at Maryland.

After she returned home Saturday, Staples watched a replay of the game. She always does that because she likes how the commentary gives her a different perspective.

As the Maryland offense lined up for its first snap, Staples noticed what she hadn’t from inside FedEx Field: The Terps sent just 10 men onto the field, leaving right guard open to honor McNair, and let the play clock run out without snapping the ball.

She cried and decided Texas Coach Tom Herman, who declined the delay-of-game penalty, was “always going to be a good guy in my book.” Then, she thought of McNair’s parents, Tonya Wilson and Martin McNair. Their son’s death, Staples said, has brought a new perspective — one in which parents realize that even a game-winning interception is relatively meaningless.

“I don’t think there’s a parent on that team that doesn’t think it could have been my kid,” Staples said.

And for a moment, she felt bad that she was so excited about her son’s performance in the first place.

“But I know Tonya wouldn’t want me to be like that,” Staples said. “I was just like, ‘Let me get these couple of tears out for Jordan and just get myself together, because it’s going to be a long season.’ ”

Read more from The Post:

Canada, in his debut as interim coach, got a new view on play-calling

John Feinstein: It’s not that Jim Harbaugh is losing at Michigan; it’s who he’s losing to

Florida State’s Willie Taggart accuses Virginia Tech of faking injuries to slow down offense

Analysis: The Washington Huskies lost, but the Pac-12 could be what buries their playoff chances