text: Media playback is not supported on this device
  England lost three wickets before tea but Moeen made a 93-ball 84 to help his side declare on 490-8, a lead of 321.
  Joe Root (72), Dawid Malan (61), Ben Stokes (58) and Chris Woakes (61 not out) also helped England, who started the day just two ahead, take control.
  West Indies' openers survived a six-over spell to reach 5-0 at the close.
  That leaves the tourists needing an unlikely 317 runs for victory, despite them dominating the first three days at Headingley.
  England, who lead the three-match series 1-0, trailed by 169 after the first innings but have moved into a position from which they need 10 wickets on the final day to win.
  It would be only the 20th time in Test history a team has won having conceded a first-innings lead of 150 or more.
  Media playback is not supported on this device
  With Stokes and Malan at the crease, England were cruising in the afternoon session, but three quick wickets for spinner Roston Chase put the match back in balance.
  Stokes was caught at long-off from the first ball after a drinks break, Malan was bowled two overs later, and Jonny Bairstow followed soon after as he was bowled playing a reverse sweep.
  That brought Moeen and Woakes together, and they survived until tea, when England were seven wickets down with a lead of 188.
  At that point the match could have gone either way, but it was England who took control as they added 133 in just 28 overs.
  Moeen was his typical attacking self, hitting a series of flowing boundaries through the off side in a 117-run partnership.
  Woakes contributed just 31 to that stand but was the perfect foil for Moeen, and took the upper hand alongside Stuart Broad when Moeen was caught in the deep.
  Shortly after Woakes became the sixth player to score a half-century in the innings, Root boldly declared, his side having reached their highest ever score without a player hitting a century.
  Having missed chances earlier in the day, West Indies were run ragged, but could at least take solace from surviving overs from James Anderson, Broad and Moeen before the close.
  Malan started the day alongside Root, with questions still to be answered over his place in the side in the build-up to this winter's Ashes.
  He was by no means fluent in his five-hour innings, hitting just seven fours in 186 balls, but battled and scrapped his way to a second Test half-century.
  It was his slowest first-class fifty but allowed Root, Stokes and Moeen to express themselves as they hit 15, 10 and 14 boundaries respectively.
  "Malan tired out the bowlers," said former England batsman Geoffrey Boycott.
  "West Indies bowled at him for so long that later in the day they bowled off line and then the middle order kill you, they just give it a whack.
  "He was gritty, determined and sewed up one end so West Indies couldn't get early wickets."
  England have long been looking for a batsman to score 'ugly runs', and here Malan showed his ability to do that.
  But his knock was not chanceless. Having escaped on day three when feathering an edge behind only for it not to be given, he was dropped at slip on 32.
  He shared a 118-run stand with Root, who continued his remarkable consistency with his 32nd Test half-century but again fell short of 100 when he cut to gully off Shannon Gabriel.
  England all-rounder Moeen Ali to TMS: "It was a nice time to go out and bat. They were tired and we counter-attacked a little bit and tried not to let them settle. There was a bit of spin but it was nice and I play spin all right.
  "I felt good before tea and thought to keep playing the same and when the bad balls come try and put them away. Me and Chris Woakes tried to build five-run partnerships.
  "Hopefully we can win the game in two sessions."
  England bowler Chris Woakes: "We were just trying to creep up to a score. Moeen was going pretty well. It was nice to watch at the other end. I try and bat like a batsman and I work hard on my batting.
  "I got to 50 and there was a signal from the dressing room saying 'get on with it'. We didn't get too much of as heads up but sometimes it is good like that. The way we were playing we were picking up runs anyway."
target: Moeen Ali's fine counter-attacking innings laid the foundation for England to push for a final-day victory in the second Test against West Indies.