Middlesex 230 (Shahzad 4-40) and 29 for 0 require a further 400 runs to beat Lancashire 392 and 266 for 8 dec (Horton 89, Brown 76, Malan 5-61)
Lancashire's ability to press home victory at Aigburth, their base in exile during last year's title-winning campaign, looks certain to be tested when they attempt to register a first win of the season against a determined Middlesex line-up.
Four victories out of six in Liverpool last summer, where they have been based while Old Trafford continues its redevelopment, played a big role in securing their surprise Championship triumph. Playing in this prosperous suburb was supposed to be their big strength - until they began their title defence.
Successive defeats against Sussex and Warwickshire at Aigburth have undermined their self-belief, but they will be hopeful of restoring it after a dramatic third day of their match against Middlesex established them as marginal favourites for victory.
With 13 wickets falling during Friday, on a wicket that still rewards careful batting, Lancashire closed 399 runs ahead of Middlesex, who were 29 without loss and facing a minimum of 96 overs on the final day to either secure a draw or claim an unlikely victory.
History would suggest a Middlesex win would take an extraordinary display, with the highest successful run chase on this ground being Kent's 360 for 4 from 105 overs back in 2002. Lancashire have history of their own on this ground, including thrilling final-day victories over Yorkshire and Hampshire last season, to provide encouragement that they can force home their first win of the summer.
"We have good memories here and we know it is a result wicket," said Paul Horton, who top-scored for Lancashire with 89. "We played Yorkshire here on this wicket so we know it can go to the wire, but we have dominated the three days and hopefully we can dominate the fourth.
"We've played well in patches this season without winning anything. We've probably not taken advantage of the positions we've been in, so tomorrow is a big day and we have to keep plugging away."
Middlesex have certainly provided Lancashire with hope after a dismal start to the third day, which they began on 155 for 5 and needing 88 runs to avoid the follow-on. In conditions that were anything but bowler-friendly, they lost five wickets for 48 runs in 15.1 overs before lunch to concede a 162 first-innings deficit.
Once again, Ajmal Shahzad proved what a shrewd loan signing he may be for the champions and demonstrated his expertise as a strike bowler. He claimed two wickets, including one with his fifth ball of the morning, to finish with impressive figures of 4 for 40. Lancashire chose not to enforce the follow-on, the intense humidity and heat and the opportunity to bowl last on a wearing wicket no doubt influencing their decision.
The contrast between Middlesex's struggles and the ease in which Lancashire's innings began was all too evident. Once Stephen Moore fell to another stunning slip catch from Ollie Rayner, Paul Horton and Karl Brown forged a 130-run second wicket partnership at a good rate.
Fresh from his match-saving century at Edgbaston a week ago, Horton set the tone for Lancashire's innings with 89 off 114 balls, including 11 fours on a ground where the slow outfield does not always make boundaries easily accessible.
Having exhausted all their other options to limit the scoring rate, Middlesex turned to the part-time legspin of Dawid Malan, who profited from Lancashire's adventure to claim an unexpected career-best of 5 for 61 from nine eventful overs.
He was punished every time he dropped short and Brown hit successive sixes from full tosses, but he did succeed in interrupting Lancashire's progress before they finally declared 428 runs ahead to give themselves 14 overs to bowl at Middlesex before the close.
Horton was particularly annoyed with himself to get out to Malan, spooning an attempted pull to mid-on shortly before tea, but he was far from alone in gifting his wicket. Ashwell Prince was stumped charging down the wicket and Steven Croft was caught in the deep after hitting 28 from 19 balls, while Brown fell for an entertaining 76 clipping behind.
By the time Glen Chapple, the captain, was run out Lancashire were far enough ahead to feel comfortable enough to declare. They were unable to claim a breakthrough before the close but their experience of nail-biting finishes last season should tell them that Aigburth has a habit of serving up final-day drama.