STARKVILLE, Miss. (AP) Mississippi flushed away a golden chance at the Golden Egg.

Luke Logan missed a 35-yard extra point after Ole Miss receiver Elijah Moore was penalized for celebrating a touchdown by crawling and pretending to urinate like a dog, and Mississippi State escaped with a 21-20 victory Thursday night in the 116th Egg Bowl.

''That's not who we are. We've been a disciplined team all year, and so just disappointed that happened,'' Rebels coach Matt Luke said. ''That's not who he is. Elijah is a good kid, and he just got caught up in the moment.''

Ole Miss (4-8, 2-6 Southeastern Conference) pulled within a point with 4 seconds remaining on Matt Corral's 2-yard pass to Moore, but Logan hooked the extra point after Moore cost the Rebels 15 yards. The extra yards also prevented Mississippi from going for a winning 2-point conversion.

The penalty was another in a long line of unsportsmanlike conduct fouls between these two teams in recent years, and oddly not even the first one featuring a player pretending to pee. Luke said he knew that as emotions flared in the annual rivalry game that showboating would need to be avoided.

''Absolutely,'' Luke said. ''We talked about it. We had five penalties. We just wanted to play a clean game. Nothing after the whistles or before the whistles was going to help us win the ballgame.''

Mississippi State (6-6, 3-5 Southeastern Conference) beat Ole Miss at home for the first since 2013, possibly saving second-year coach Joe Moorhead's job.

Moorhead was fiery in his defense of the job his staff has done with this team, overcoming a litany of academic suspensions and several injuries to key players.

''To me it was an exclamation point on the narrative that I'm not the right man for this job or this team, or that I can't coach in this league,'' Moorhead said. ''This is my school, my team, and this is my program. They'll have to drag my Yankee ass out of here.''

The teams combined for seven sacks and 17 tackles for loss, and Mississippi State won the turnover battle 3-1. The Bulldogs' Erroll Thompson had 11 tackles, one for a loss, a pass deflection and a forced fumble.

''Erroll's our team captain, you know, and he has the confidence of the team,'' Moorhead said. ''For him to play the way he did, and just the entire defense, it was a great team win.''

The Bulldogs scored two first-half touchdowns, the first on Nick Gibson's 27-yard run and the second on the next possession on quarterback Garrett Shrader's 1-yard run. Ole Miss responded with two touchdowns of its own, with J.R. Plumlee scoring on a 2-yard run and Jerrion Ealy on a 5-yarder to tie it at 14 at the half.

Midway through the third quarter, the Bulldogs sacked Plumlee three times on the same drive, the third forcing a fumble. Seven plays later, Shrader scored on a 5-yard run to put Mississippi State up 21-14.

After pulling Plumlee in favor of Corral, Ole Miss had two different red-zone opportunities in the fourth quarter. The other ended with a Marcus Murphy interception.

On the final drive of the game, Mississippi State committed three of its five total penalties and Ole Miss ran nine plays inside the 15 before eventually connecting for the touchdown.

THE TAKEAWAY

Ole Miss: The Rebels are young and continue to show signs of life under Luke, but inconsistent play and the lack of a clear offensive strategy are the biggest reasons they'll be sitting at home this bowl season.

Mississippi State: After a long season that fell well short of expectations, an emotional home win over a hated rival might just be enough to keep Moorhead from losing his job. But maybe not.

Copyright 2019 by STATS LLC and Associated Press. Any commercial use or distribution without the express written consent of STATS LLC and Associated Press is strictly prohibited.