Eoin Morgan hit a superb century against his native Ireland to ensure his adopted country England avoided embarrassment in the RSA Challenge one-day international.
Ravi Bopara also cracked a rapid hundred, his first in an ODI, in a superb unbroken 226-run stand with Morgan as England recovered from 48 for four to win in Malahide by six wickets with seven overs to spare.
When Tim Murtagh then took three early England wickets, Ireland's hopes of repeating their famous 2011 World Cup win over their neighbours were high.
But although the hosts continued to look much sharper in the field than under-strength England had done, the experience of Morgan and Bopara - making amends for falling short in the Champions Trophy final in June and reaching his highest ODI score - shone through.
Morgan ended unbeaten on 124 after hitting eight fours and four sixes and Bopara finished in a hurry, reaching 101 after 10 fours and five sixes. It was a world record fifth-wicket partnership in one-day international cricket.
Despite the flat finish, it was still a momentous occasion for Irish cricket with a near-capacity crowd of 10,000 spectators being fully entertained.
There had been suggestions the Irish had been slighted by England's decision to rest a number of star names after their Ashes summer, and irritated by the selections of Morgan and Rankin.
Overcoming his poor form for Warwickshire this summer, he struck 14 fours and a six before falling to Rankin, who was the only one of England's three debutants to shine.
It was not a day for another making his first ODI appearance, Michael Carberry, to remember.
The Hampshire batsman dropped two regulation catches in the deep, including one off Porterfield on 85, and then fell early in the reply.
Rankin overcame an initially wayward start - his second delivery went for five wides - to finish with four for 46.
He had Peter Stirling caught off the edge by the third debutant, Gary Ballance, at second slip and then forced former England batsman Ed Joyce back to dislodge a bail with his foot.
That double strike reduced the hosts to 36 for two but Porterfield began to repair the damage in a 59-run partnership with fellow left-hander Niall O'Brien for the third wicket.
O'Brien then flashed narrowly wide of wicketkeeper Jos Buttler, a miss compounded by Balance's comical failure to prevent a four.
His luck finally ran out when Tredwell nipped one back through his defences to bowl him for 26.
Tredwell followed up by bringing one back the other way into right-hander Gary Wilson to win a leg before decision, although replays suggested the wicketkeeper-batsman was unlucky.
Kevin O'Brien was unable to build on a promising start and his slightly mistimed pull off Bopara was brilliantly caught by Morgan.
Porterfield had a scare when he nicked one straight past Ballance at slip and his innings should have ended 15 short of three figures when the hapless Carberry dropped another catch.
Carberry, by then a figure of fun for the crowd, made an unimpressive entry into the attack, going for 12 off his one over with Porterfield particularly keen to get stuck in as he approached his hundred.
He reached the landmark off 131 balls with a pulled six off Rankin.
Rankin hit back to bowl his county colleague in the 46th over and then trapped John Mooney lbw for 27 four balls later.
That briefly slowed Ireland's momentum but Max Sorensen took up the challenge, clubbing an unbeaten 24, with two sixes, in the closing overs as the hosts finished on 269 for seven.
England's reply began poorly as Carberry's dismal day continued when he was trapped leg before by Trent Johnston for 10 in the fourth over.
Luke Wright had a lucky escape when Murtagh had a strong lbw appeal turned down. The reprieve was only temporary as Murtagh forced Wright to chop onto his own stumps in the ninth over.
Two balls later Ballance was unable to get his bat out of the way of a ball he attempted to leave and was caught behind.
James Taylor looked composed for his 25 but his dismissal, clean bowled by Murtagh in the 15th over, left England in trouble.
Yet there was to be no stopping Morgan and Bopara, who began slowly but eventually finished with a flourish.
Morgan brought up his century with a six, and after being dropped on the boundary by Niall O'Brien he finished the job with another maximum.