Pettersen was chosen by captain Catriona Matthew despite having played just twice since November 2017 before the wild cards were named, since when she had finished 59th in the CP Women’s Open and missed the cut in the Cambia Portland Classic.
However, the 38-year-old Norwegian delivered when it mattered by holing from six feet for a winning birdie on the 18th hole of her match with Marina Alex to give Europe victory by 14.5 points to 13.5.
Soon after, Pettersen announced she was retiring from the professional game, saying: “I think this is a perfect end for my professional career. It does not get any better.
“I never thought I was going to be here four months ago.
“To have the confidence from Beany (Matthew) to give me a go, this is it. I am completely done.
“I don’t have any plans from tomorrow.
“I am pretty much closing it down.”
“I had faith in her all the time,” Matthew said, who rated the victory above her Women’s British Open triumph a decade ago. “This is the best without doubt. With the team around you nothing tops this to be honest.”
Earlier, Pettersen had said she did not know her putt was for the win, adding: “It’s all just a bit of a blur.
“I never thought I was going to do this again.
“You have to trust you are good enough and this is a fantastic win for the team.”
Starting the day tied at 8-8, the home side won three of the first four singles matches courtesy of Carlota Ciganda, Georgia Hall and Celine Boutier, Hall and Boutier having also won all three of their matches together over the first two days.
However, Nelly Korda also maintained her unbeaten record by recovering from three down with nine to play to beat Sweden’s Caroline Hedwall.
Rookie Brittany Altomare thrashed Northallerton-born and USA-based wildcard Jodi Ewart Shadoff 5&4 and Angel Yin’s triumph over Azahara Munoz made it 11-11.
Jessica Korda took the United States in front for the first time by closing out Caroline Masson 3&2 and the momentum looked to have crucially turned in favour of the visitors.
Charley Hull took the lead against Megan Khang for the first time on the 16th, only to make a mess of the 18th and have to settle for half a point, while Lizette Salas defeated Holland’s Anne Van Dam on the last to get within half a point of retaining the trophy.
Anna Nordqvist kept European hopes alive with a 4&3 win over Morgan Pressel in the bottom match and Bronte Law then holed from 20 feet for birdie on the 16th to edge ahead of McDonald.
A par on the 17th was enough to secure the win for Law and leave the outcome in the hands of Pettersen and Alex on the 18th.
Pettersen hit a superb approach to six feet and, after Alex missed from twice the distance, the 38-year-old amazingly held her nerve to hole the winning putt and spark jubilant scenes among a side who had been written off before a ball was struck.