Two superb Aaron McEneff goals helped Derry City maintain their winning run at the redeveloped Brandywell as they beat unlucky St Pat's.
McEneff brilliantly volleyed Derry ahead on 10 minutes after a mistake from Pat's defender Kevin Toner.
But Dean Clarke hit a post and a Jake Keegan effort was harshly disallowed as Pat's dominated before half-time.
McEneff doubled Derry's lead on 74 but Clarke pulled a goal back as the home side had to cling on late in the game.
In the final action of the match, Derry defender Darren Cole had to make a dramatic clearance off his own line after home keeper Gerard Doherty had made a brilliant save to block a pointblank Pat's chance.
Cole was embraced by his team-mates as referee Robert Harvey blew the final whistle immediately after the last-ditch invention by the Derry defender.
Shiels admits 'Derry got the breaks'
Speaking shortly after the final whistle, Derry manager Kenny Shiels admitted that his team had got the breaks with referee Harvey's decision to rule out Keegan's first-half effort mystifying and Pat's dominating for long periods as they missed numerous chances.
Four of the Derry starting line-up had been on under-21 international duty over the past fortnight with Ronan Curtis and the Hale brothers Rory and Ronan in action for the Republic of Ireland and Conor McDermott representing Northern Ireland.
Shiels felt the exertions of the under-21 duty had shown in the cases of a couple of players but McDermott looked to be exempted from this as he went on to produce a fine performance.
After a lively start for Pat's, Derry took the lead against the run of play as McEneff brilliantly volleyed to the net after blocking Toner's attempt to make a precise clearance out of defence.
With Toner regrouping to set up a number of Pat's attacks with his runs out of defence, the visitors quickly took control.
Clarke should have levelled on 23 minutes as he fired against a post from close-range after Doherty had only managed to parry a Keegan shot.
From the resultant corner, Pat's looked to have levelled but referee Harvey adjudged that Keegan was offside as he got the final touch to poke Clarke's header past Doherty. Pat's manager Liam Buckley was predictably furious with the decision.
Clarke was inches wide with a further Pat's chance just before the interval as Kenny Shiels must have been relieved to get access to his players at the break.
Patterson and Ronan Hale went close for Derry in the third quarter but Pat's were still looking the more dangerous side with Conan Byrne blazing over another great chance to equalise.
However, McEneff extended Derry's lead on 74 as he lashed to the roof of the net from the edge of the penalty area after his own superbly initial ball had played Patterson into space before taking a return ball from the striker.
With Pat's patient passing game continuing to create chances, Clarke finally opened their account on 81 after Doherty had failed to hold an Owen Garvan shot.
As Pat's chased an equaliser, Clarke headed a glorious opportunity straight at Doherty on 88 before Cole's late injury-time heroics kept Derry in front.
With Cork City winning 4-0 at Bray, Derry remain seven points off the pace in fifth spot but they have a game on the leaders.