Linfield won a stormy match at Glenavon with one man from each side being sent-off after fighting broke out between players late in the game.
Glenavon's Kevin Braniff and Linfield's Seanan Clucas were shown straight red cards by referee Mervyn Smyth.
Andrew Waterworth had given the Blues the lead with a 17th-minute strike.
Braniff drilled in for Glenavon after a free-kick was awarded for a back pass but Linfield hit back to score the winner with a Jimmy Callacher header.
It was a much-needed victory for Warren Feeney's Linfield who had slipped to fifth after back-to-back Premiership defeats.
The Blues move up to fourth and are three points behind champions and leaders Cliftonville.
The ugly brawl involved many players from both sides and came towards the end of a game in which emotions were running high.
Waterworth's goal was a superbly-taken first-time strike from Sammy Morrow's nod down.
Glenavon player-manager Gary Hamilton, one of the home team's substitutes, was sent-off for comments made from the bench.
Morrow then missed a chance to stretch Linfield's lead when he lofted a shot over from Ross Clarke's pull back.
In the second half Linfield assistant manager Andy Todd was sent to the stands for something said to the match officials.
The drama really started in the 76th minute when Linfield defender Niall Quinn was adjudged to have hit a back pass to Ross Glendinning.
Linfield argued that Quinn had not deliberately played the ball to his keeper.
However, a free was awarded virtually on the six-yard line and it was played to Braniff who blasted through the wall.
Linfield were not to be denied though and former Glentoran man Callacher headed in from Stephen Lowry's floated free for an 85th-minute winner.