Edinburgh-based Payne, who won silver at the 2008 Beijing Games, required a top-nine result in Portugal.
China's Xin Xin took victory, finishing the 10km race in one hour 55.12 seconds, with Payne 0.8 seconds behind.
Stirling-based Danielle Huskisson was ninth but misses out with only one athlete qualifying from each nation.
Payne, who was fourth at London 2012, told BBC Sport: "It totally was emotional and hasn't really sunk in, but I'm definitely going to cry later - tears of happiness.
"I mean I have put so much into this last four years and I'm so happy that it's all paid off in the end.
"Coming fourth at a home Olympics was the worst place to come and I took a year out after that, but I just decided at one point I needed to fully commit to it. Getting back into training was hard, but I have loved the journey - even today when I was elbowed in the face!
"Everything I've done is to get prepared to stand on the podium in Rio. I'll be doing everything that I can to make that happen."
The men's event will take place over the same course in Setubal on Sunday at 15:30 BST.
British Swimming already has Jack Burnell as a consideration for nomination to Team GB after he finished fifth in the 10km event at last year's World Championships.
Sign up to My Sport to follow swimming news and reports on the BBC app.
Two-time open water world champion Keri-Anne Payne finished second at the final Olympic qualification event in Portugal to secure a place at Rio 2016.