Neil Flynn scored 1-07 as Kildare set up a Leinster SFC semi-final against Westmeath with victory in Portlaoise but they were pushed all the way by a gallant Offaly side.

After their extra-time win over Louth last week, John Maughan's Offaly started this game brightly and must have been scratching their heads to be 0-06 to 0-05 behind at half-time after largely dominating the opening period.

However, Jack O'Connor’s side upped their game in the second half and by the end were full value for a win.

Niall McNamee and Cian Farrelll scored early frees to give Offaly the advantage but Kildare quickly struck back to level the game.

That summed up with the first half with neither side able to get on top on the scoreboard, despite Offaly looking the livelier outfit.

Mark Donnellan denied Offaly a goal in the 23rd minute when the Kildare defence was marked absent and allowed Anton Sullivan through on goal but he couldn’t beat the big goalkeeper.

Fergal Conway scored two points for Kildare

A Mick O’Grady mark with the last kick of the half sent Kildare to the dressing rooms with a half-time lead and they looked more like the side that gained promotion to Division 1 through the third quarter.

They outscored Offaly by 0-06 to 0-03 during that spell, with Neil Flynn increasingly prominent. He scored a well-struck '45 and, a point off his left foot with 20 minutes to go, and when he shot past Paddy Dunican in the 57th minute to make it 1-13 to 0-08, Kildare looked set to go on comfortably.

But Kildare rarely, if ever, do anything the easy way. Three minutes later they were down to 14 men when Ryan Houlihan was shown a second yellow card for a tackle on McNamee, and they went down to 13 men when Jimmy Hyland was black-carded for a clumsy foul on Johnny Moloney.

Offaly had previously began to look tired but that gave them renewed hope and they pressed forward.

Cian Farrell scored twice in injury-time to bring his tally to seven points, and there was a couple of dangerous late balls in around the Kildare square but they held on to secure their last-four place.

Kildare: Mark Donnellan; Mark Dempsey, Mick O’Grady (0-01, 1m), Eoin Doyle; Kevin Flynn, David Hyland, Ryan Houlihan; Kevin Feely (0-01), Aaron Masterson (0-01); Conor Hartley, Fergal Conway (0-02), Neil Flynn (1-07, 4f, 2 ‘45); Darragh Kirwan (0-01), Ben McCormack, Jimmy Hyland (0-02).

Subs: Brian McLoughlin for Kirwan (54), Shea Ryan for Conway (57), Paddy Brophy for Hartley (70), Con Kavanagh for K Flynn (70).

Offaly: Paddy Dunican (0-01, ‘45); James Lalor, Eoin Rigney, Niall Darby; Colm Doyle, Carl Stewart, David Dempsey; Cathal Mangan, Jordan Hayes; Johnny Moloney, Peter Cunningham, Anton Sullivan (0-01); Niall McNamee (0-02, 2f), Cian Farrell (0-08, 4f), Ruairi McNamee.

Subs: Shane Horan for Rigney (25), Bernard Allen (0-01) for R McNamee (28), Eoin Carroll for Mangan (ht), Bill Carroll for Cunningham (58), Aaron Leavy for Doyle (58).

Referee: Martin McNally (Monaghan).